home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 201-220 / scopedisk202 / bbbbs2 / rexx / bbssysop.rexx < prev    next >
OS/2 REXX Batch file  |  1995-03-19  |  99KB  |  3,652 lines

  1. /***      $VER: bbsSYSOP.rexx  version 2.0    2 Mar 1991  ()           ***/
  2. /***  copyright 1990 Richard Lee Stockton * FREELY DISTRIBUTABLE *     ***/
  3.  
  4. /***   bbsSYSOP.rexx  -  BBBBS.baud without the BaudBandit stuff.      ***/
  5. /***                          Will multi-task with BBBBS.baud          ***/
  6.  
  7. /***  THIS IS THE SYSOP'S VERSION OF BBBBS.baud FOR LOCAL USE ONLY!    ***/
  8.  
  9.  
  10. /* If the QuickSortPort not found then try to run setup.rexx . */
  11.  
  12. IF ~show('P','QuickSortPort') THEN CALL setup.rexx();
  13.  
  14. /* If the QuickSortPort is STILL not found then we gotta quit. */
  15.  
  16. IF ~show('P','QuickSortPort') THEN EXIT;
  17.  
  18.  
  19. /*-------  BBS Directories  (may be created with SETUP option) ----------*/
  20. bbs.    = ''
  21.  
  22. bbs.81  = 'Information'   /* text files from sysop for the user to read */
  23.  
  24. bbs.86  = 'Scratch'
  25. bbs.87  = 'BBS_HELP'
  26. bbs.88  = 'rexxDoors'
  27. bbs.89  = 'BBS_TEXT' /* text files for BBS use. WELCOME HELLO, NEW etc. */
  28. bbs.90  = 'FileNotes'
  29. bbs.91  = 'BBS_LIBS'
  30. bbs.92  = 'BBS_MSGS'
  31. bbs.93  = 'Lists'
  32. bbs.94  = 'Numbers'                 /* 1st & last messages, mail, files */
  33. bbs.95  = 'Usage'
  34. bbs.96  = 'Logs'
  35. bbs.97  = 'EMailFiles'
  36. bbs.98  = 'EMail'
  37. bbs.99  = 'Users'
  38.  
  39.  
  40. /*-------------- VARIABLES ----------------------------------------------*/
  41.  
  42. bbsprefs.    = 0  /* start with all prefs OFF */
  43. lastread.    = 0
  44. dirnum       = 1
  45. linesperpage = 19
  46. level        = 0
  47. lastread.    = 0
  48. totwrit.     = 0
  49. lastbrowse   = 0
  50. warnings     = 0
  51. winnings     = 0
  52. nonstop      = 0
  53. newfilesdate = ''
  54. newpassword  = ''
  55. replysubj    = ''
  56. msgdir       = 1
  57. menuflag     = 1
  58. logonflag    = 1
  59. data.        = ''
  60.  
  61. /*-------------- TEXT ---------------------------------------------------*/
  62.  
  63. text.   = ''                 /* This is the user data structure by line */
  64. text.1  = '   Full Name'
  65. text.2  = '      Street'
  66. text.3  = 'City, ST Zip'
  67. text.4  = ' Voice Phone'
  68. text.5  = '    Password'
  69. text.6  = '    Protocol'
  70. text.7  = 'LinesPerPage'
  71. text.8  = ' Preferences'
  72. text.9  = '    Computer'
  73. text.10 = '   Interests'
  74. text.11 = 'Session Time'
  75. text.12 = 'FirstSession'
  76. text.13 = 'Last Session'
  77. text.14 = '      UpLoad'
  78. text.15 = '    Download'
  79. text.16 = '   Last File'
  80. text.17 = 'Ratio  Email'
  81. text.18 = '    Winnings'
  82. text.19 = '       Usage'
  83. text.20 = '       Level'
  84. text.21 = 'Exclude DIRS'
  85. text.22 = '   Msgs Read'
  86. text.23 = '   Msgs Writ'
  87.  
  88.  
  89. /* page control codes */
  90.  
  91. lineup='1B'x'M'
  92.  
  93.  
  94. /* try to trap everything */
  95.  
  96. SIGNAL ON BREAK_C
  97. OPTIONS RESULTS
  98. OPTIONS FAILAT 10
  99. SIGNAL ON BREAK_E
  100. SIGNAL ON SYNTAX
  101. SIGNAL ON FAILURE
  102.  
  103.  
  104. ARG option .
  105.  
  106.  
  107. /*--------------- SETUP -----------------------------------------*/
  108.  
  109. SAY '       - Baud Bandit Bulletin Board System from Gramma Software -'
  110.  
  111. arg='s:CONFIG.BBS'
  112. IF ~EXISTS(arg) THEN arg='BBS:BBS_TEXT/CONFIG.BBS'
  113. IF readlines(arg 1) THEN
  114.   DO
  115.     SAY 's:CONFIG.BBS and BBS:BBS/CONFIG.BBS are both missing!'
  116.     SIGNAL DONE2
  117.   END
  118. compos=POS('/*',lynes.1)
  119. IF compos>0 THEN lynes.1=LEFT(lynes.1,compos-1)
  120. bbsname            = STRIP(lynes.1)
  121. sysop              = WORD(lynes.2,1)
  122. compos=POS('/*',lynes.3)
  123. IF compos>0 THEN lynes.3=LEFT(lynes.3,compos-1)
  124. exclusionlist      = STRIP(lynes.3)
  125. bbsdevice          = WORD(lynes.4,1)
  126. sysoplevel         = WORD(lynes.5,1)
  127. bbspath            = WORD(lynes.6,1)
  128. IF ~EXISTS(bbspath) THEN
  129.   DO
  130.     SAY bbspath 'does not exist!'
  131.     SIGNAL DONE2
  132.   END
  133. testchar=RIGHT(bbspath,1)
  134. IF testchar~='/' & testchar~=':' THEN bbspath=bbspath'/'
  135. CALL SETCLIP('BBS_path',bbspath)
  136.  
  137. msgpath            = WORD(lynes.7,1)
  138. IF ~EXISTS(msgpath) THEN
  139.   DO
  140.     SAY msgpath 'does not exist!'
  141.     SIGNAL DONE2
  142.   END
  143. testchar=RIGHT(msgpath,1)
  144. IF testchar~='/' & testchar~=':' THEN msgpath=msgpath'/'
  145. msgpath=msgpath'MSG'
  146.  
  147. libpath            = WORD(lynes.8,1)
  148. IF ~EXISTS(libpath) THEN
  149.   DO
  150.     SAY libpath 'does not exist!'
  151.     SIGNAL DONE2
  152.   END
  153. testchar=RIGHT(libpath,1)
  154. IF testchar~='/' & testchar~=':' THEN libpath=libpath'/'
  155.  
  156. spellpath          = WORD(lynes.9,1)
  157. IF bbsprefs.5 & ~EXISTS(spellpath) THEN
  158.   DO
  159.     SAY spellpath 'does not exist!'
  160.     bbsprefs.5=0
  161.   END
  162.  
  163. /* expansion config would go here, lines 10-11 */
  164.  
  165. SYSTEM_SPACE_LIMIT = WORD(lynes.12,1)
  166. maxidle            = WORD(lynes.13,1)
  167. maxtime            = WORD(lynes.14,1)
  168. maxbps             = WORD(lynes.15,1)
  169. IF ~DATATYPE(maxbps,'N') THEN maxbps=2400
  170. DO i=16 TO 30
  171.   j=i-15
  172.   bbsprefs.j=STRIP(WORD(lynes.i,1))
  173. END
  174. IF bbsprefs.10 THEN scratch=bbspath'Scratch'
  175. ELSE scratch='RAM:Scratch'
  176. CALL MAKEDIR(scratch)
  177.  
  178. SAY 'The ARexx portions of this software are copyright 1990 Richard Lee Stockton'
  179. SAY '        - FREELY DISTRIBUTABLE as long as this notice remains -'
  180. SAY
  181.  
  182.  
  183. IF option='SETUP' THEN
  184.   DO
  185.     SAY 'Making sure all needed directories are here...'
  186.     DO i=80 TO 99
  187.       IF bbs.i~='' THEN CALL MAKEDIR(bbspath||bbs.i)
  188.     END
  189.   END
  190.  
  191. CALL colors(1);
  192.  
  193. msg.=''
  194. IF readopen(bbspath'Lists/Conferences') THEN
  195.   DO
  196.     DO i=1
  197.       line=READLN(f)
  198.       IF line='END' THEN BREAK;
  199.       IF EOF(f) THEN BREAK;
  200.       num=WORD(line,1)
  201.       IF DATATYPE(num,'N') THEN msg.num=WORD(line,2)
  202.     END
  203.     CALL CLOSE(f)
  204.   END
  205. IF option='SETUP' THEN
  206.   DO
  207.     DO i=1 TO 99
  208.       IF msg.i~='' THEN CALL MAKEDIR(msgpath||i)
  209.     END
  210.   END
  211.  
  212. files.=''
  213. IF readopen(bbspath'Lists/Files') THEN
  214.   DO
  215.     DO i=1
  216.       line=READLN(f)
  217.       IF EOF(f) THEN BREAK;
  218.       num=WORD(line,1)
  219.       line=DELWORD(line,1,1)
  220.       IF DATATYPE(num,'N') THEN files.num=line
  221.     END
  222.     files.0=i-1
  223.     CALL CLOSE(f)
  224.   END
  225.  
  226. courtesy=''
  227. IF EXISTS(bbspath'Lists/Courtesy') THEN
  228.   DO
  229.     IF readopen(bbspath'Lists/Courtesy') THEN
  230.       DO
  231.         DO i=1
  232.           line=READLN(f)
  233.           IF EOF(f) THEN BREAK;
  234.           courtesy=courtesy line
  235.         END
  236.         CALL CLOSE(f)
  237.       END
  238.   END
  239.  
  240. dirs.=''
  241. IF readopen(bbspath'Lists/Libraries') THEN
  242.   DO
  243.     DO i=1
  244.       line=READLN(f)
  245.       IF line='END' | EOF(f) THEN LEAVE i
  246.       num=WORD(line,1)
  247.       IF DATATYPE(num,'N') THEN dirs.num=STRIP(WORD(line,2))
  248.     END
  249.     CALL CLOSE(f)
  250.   END
  251. IF option='SETUP' THEN
  252.   DO
  253.     SAY 'Making sure all file library directories are here...'
  254.     DO i=1 TO 99
  255.       IF dirs.i~='' THEN CALL MAKEDIR(libpath||dirs.i)
  256.     END
  257.   END
  258.  
  259. CALL loaduserlist();
  260.  
  261. /** Identify (title) message */
  262. IF EXISTS(bbspath'BBS_TEXT/HELLO') THEN
  263.   DO
  264.     SAY 
  265.     arg=bbspath'BBS_TEXT/HELLO'
  266.     CALL readlines(arg 1)
  267.     CALL seelines();
  268.   END
  269. SAY pen3'Courtesy List:'def
  270. SAY courtesy
  271. SAY
  272.  
  273.  
  274. /** Ask for name */
  275. name=''
  276. DO count=1 TO 3
  277.   name=getinput(1 0 'Please enter name: ')
  278.   name=SPACE(name,1,'_')
  279.   IF name='NEW' THEN LEAVE count;
  280.   IF name~='' THEN
  281.     DO
  282.       IF FIND(userlist,name)>0 THEN LEAVE count
  283.       IF FIND(exclusionlist,name)>0 THEN
  284.         DO
  285.           SAY 'Sorry, that is a reserved name.'
  286.           name=''
  287.         END
  288.       IF bbsprefs.7 | FIND(courtesy,name)>0 THEN
  289.         DO
  290.           SAY
  291.           SAY 'Welcome' name'!'
  292.           SAY 'You will be automatically validated after you enter your user info.'
  293.           SAY
  294.           LEAVE count
  295.         END
  296.     END
  297.   IF count<3 THEN SAY 'New Users please enter NEW to apply for validation.'
  298. END
  299. IF count>3 THEN SIGNAL DONE
  300. CALL checkUser()
  301.  
  302.  
  303. /** Opening Display after logon. Seen by all Users ONCE A DAY. It first  **/
  304. /** looks for a unique yearly data (ie, WELCOME.0704), then daily data   **/
  305. /** (ie, WELCOME.Fri), and finally a simple, everyday 'WELCOME' datafile **/
  306.  
  307. IF DATE('I')>lastondate THEN
  308.   DO
  309.     arg=bbspath'BBS_TEXT/WELCOME.'RIGHT(DATE('S'),4)
  310.     IF ~EXISTS(arg) THEN
  311.       DO
  312.         arg=bbspath'BBS_TEXT/WELCOME.'LEFT(DATE('W'),3)
  313.         IF ~EXISTS(arg) THEN arg=bbspath'BBS_TEXT/WELCOME'
  314.       END
  315.     IF EXISTS(arg) THEN
  316.       DO
  317.         SAY 
  318.         CALL showtext(arg);
  319.         nonstop=0
  320.       END
  321.   END
  322. SAY 
  323.  
  324. IF bbsprefs.1 THEN
  325.   DO
  326.     CALL doGrin();
  327.     CALL Moon.rexx();
  328.     CALL Time.rexx();
  329.     SAY
  330.   END
  331. CALL sortlibraries();
  332.  
  333. CALL TIME('R')
  334.  
  335. CALL logonstats();
  336. CALL newinfo(1);
  337. logonflag=0
  338. CALL readmail(0)
  339. IF level<99 & level>sysoplevel THEN
  340.   DO
  341.     CALL showtext(bbspath'Email/'sysop'/NEW_FILES')
  342.     CALL showtext(bbspath'Email/'sysop'/NEW_USERS')
  343.   END
  344. CALL setdir(libpath||dirs.1)
  345.  
  346.  
  347. /*-------------------------- MAIN ---------------------------------------*/
  348.  
  349. IF menu~='ALL' THEN menu='MAIN'
  350.  
  351. RESTART:
  352. waitchar=''
  353. string=''
  354. IF level<1 THEN menu='NEW'
  355. DO WHILE(opt~='G')
  356.   go=0
  357.   DO WHILE(~go)
  358.     IF waitchar='' | waitchar='?' THEN
  359.       DO
  360.         commands='cghiqswxyz!#'
  361.         IF level>0  THEN commands='bcdefghijlmnoprstuvwxyz!$#.'
  362.         IF level>sysoplevel THEN commands=commands'k%^()='
  363.         IF level=99 THEN commands=commands'@&-'
  364.         commands=commands'?'
  365.         IF menuflag | waitchar='?' | string='?' THEN CALL menus();
  366.         ELSE SAY pen3'COMMANDS:'def commands
  367.       END
  368.     line=''
  369.     line=line||bak2' 'TIME('C')' 'def
  370.     IF menu='ALL' | menu='FILE' THEN
  371.       line=line pen3'FILE_LIBRARY:'plaindir||def
  372.     ELSE IF menu='MSG' THEN line=line pen3'MESSAGES:'def
  373.     ELSE line=line pen3'MAIN:'def
  374.     OPTIONS PROMPT line' > '
  375.     IF waitchar='' THEN PARSE PULL string' 'arg .
  376.     ELSE PARSE VAR waitchar string' 'arg .
  377.     string=UPPER(STRIP(string))
  378.     IF string='OFF' | string='BYE' THEN SIGNAL LOGOUT;
  379.     waitchar=''
  380.     IF DATATYPE(string,'N') THEN
  381.       DO
  382.         dirnum=string
  383.         CALL chdir2();
  384.         CALL since();
  385.       END
  386.     opt=left(string,1)
  387.     go=1    /* check for access */
  388.     IF POS(opt,UPPER(commands))=0 THEN go=0
  389.   END
  390.   OPTIONS PROMPT 'Filename: '
  391.   SELECT
  392.     WHEN(opt='B') THEN CALL browse();
  393.     WHEN(opt='C') THEN CALL editor('MAIL' sysop);
  394.     WHEN(opt='D') THEN CALL dload();
  395.     WHEN(opt='E') THEN CALL readmail(1);
  396.     WHEN(opt='F') THEN IF menu~='ALL' THEN menu='FILE'
  397.     WHEN(opt='H') THEN CALL help('MAIN');
  398.     WHEN(opt='I') THEN CALL information();
  399.     WHEN(opt='J') THEN CALL jump2rexx();
  400.     WHEN(opt='K') THEN CALL killuser();
  401.     WHEN(opt='L') THEN CALL list();
  402.     WHEN(opt='M') THEN IF menu~='ALL' THEN menu='MSG'
  403.     WHEN(opt='N') THEN CALL newfiles();
  404.     WHEN(opt='O') THEN CALL otheruser();
  405.     WHEN(opt='P') THEN CALL editor('MSG')
  406.     WHEN(opt='R') THEN CALL readmessages();
  407.     WHEN(opt='S') THEN CALL bbsSEARCH();
  408.     WHEN(opt='U') THEN CALL uload(1);
  409.     WHEN(opt='V') THEN CALL viewtext();
  410.     WHEN(opt='W') THEN CALL showuserlist()
  411.     WHEN(opt='X') THEN CALL switchmenuflag();
  412.     WHEN(opt='Y') THEN CALL edituser();
  413.     WHEN(opt='Z') THEN CALL counts();
  414.     WHEN(opt='@') THEN CALL shell();
  415.     WHEN(opt='#') THEN CALL switchcolors();
  416.     WHEN(opt='$') THEN IF menu='ALL' THEN menu='MAIN'; ELSE menu='ALL'
  417.     WHEN(opt='%') THEN CALL editnote();
  418.     WHEN(opt='^') THEN CALL readlogs();
  419.     WHEN(opt='&') THEN CALL sysED(1);
  420.     WHEN(opt='-') THEN CALL edfilenote();
  421.     WHEN(opt='(') THEN CALL filereport();
  422.     WHEN(opt=')') THEN CALL mailreport();
  423.     WHEN(opt='=') THEN CALL levelreport();
  424.     WHEN(opt='.') THEN menu='MAIN'
  425.     WHEN(opt='?') & menuflag THEN CALL help('MAIN');
  426.     OTHERWISE NOP
  427.   END
  428. END
  429. SIGNAL LOGOUT
  430. EXIT;       /* an extra margin of safety */
  431.  
  432.  
  433. /*------------------------- FUNCTIONS ----------------------------------*/
  434.  
  435. showtext:
  436. PARSE ARG arg .
  437. IF EXISTS(arg) THEN
  438.   DO
  439.     CALL readlines(arg 1);
  440.     CALL seelines();
  441.     nonstop=0
  442.     CALL waiting();
  443.   END
  444. RETURN;
  445.  
  446.  
  447. doGrin:
  448. CALL setdir(bbspath'rexxDoors')
  449. CALL Grin_du_Jour.rexx();
  450. SAY
  451. RETURN;
  452.  
  453.  
  454. killuser:
  455. IF level<=sysoplevel THEN RETURN;
  456. IF arg='' THEN
  457.   DO
  458.     OPTIONS PROMPT 'Username: '
  459.     PARSE PULL arg .
  460.   END
  461. IF STRIP(arg)='' THEN RETURN;
  462. arg=UPPER(arg)
  463. arg=SPACE(STRIP(arg),1,'_')
  464. IF getinput(1 1 'Really kill' arg'? (nY) > ')='N' THEN RETURN;
  465. SAY 'Working...'lineup
  466. IF readlines(bbspath'Users/'arg) THEN SAY 'User not found.'
  467. IF level<=lynes.20 THEN
  468.   DO
  469.     SAY '*** Tsk! Tsk!  Your level is not greater than' arg'.'
  470.     RETURN;
  471.   END
  472. CALL DELETE(bbspath'Users/'arg)
  473. IF EXISTS(bbspath'Email/'arg) THEN
  474.   ADDRESS COMMAND 'DELETE >*' bbspath'Email/'arg 'ALL'
  475. IF EXISTS(bbspath'EmailFiles/'arg) THEN
  476.   ADDRESS COMMAND 'DELETE >*' bbspath'EmailFiles/'arg 'ALL'
  477. CALL DELETE(bbspath'Lists/USERS')
  478. CALL loaduserlist();
  479. SAY 'User file, Email & EmailFiles for' arg 'have been deleted.'
  480. RETURN;
  481.  
  482.  
  483. menus:
  484. SAY
  485. IF menu='MSG' THEN
  486. DO
  487.     SAY pen6'       ____________'def
  488.     SAY pen6'  ____/  'pen3'Messages'pen6'  \_____'def
  489.     SAY pen6' |                       |'def
  490.     SAY pen6' |'def'   ['pen3'H'def']elp              'pen6'|'def
  491.     SAY pen6' |'def'   ['pen3'P'def']ost messages     'pen6'|'def
  492.     SAY pen6' |'def'   ['pen3'R'def']ead messages     'pen6'|'def
  493.     SAY pen6' |'def'   ['pen3'S'def']earch messages   'pen6'|'def
  494.     SAY pen6' |'def'   ['pen3'E'def']mail (private)   'pen6'|'def
  495.     SAY pen6' |'def'   ['pen3'C'def']omment to SYSOP  'pen6'|'def
  496.     SAY pen6' |'def'   ['pen3'!'def'] YELL for SYSOP  'pen6'|'def
  497.     SAY pen6' |'def'   ['pen3'^'def'] view BBS logs   'pen6'|'def
  498.     SAY pen6' |'def'   ['pen3')'def'] email report    'pen6'|'def
  499.     SAY pen6' |'def'   ['pen3'='def'] level report    'pen6'|'def
  500.     SAY pen6' |'def'   ['pen3'&'def'] online editor   'pen6'|'def
  501.     SAY pen6' |'def'   ['pen3'@'def'] dos shell       'pen6'|'def
  502.     SAY pen6' |'def'   ['pen3'F'def']iles menu        'pen6'|'def
  503.     SAY pen6' |'def'   ['pen3'.'def'] main menu       'pen6'|'def
  504.     SAY pen6' |_______________________|'def
  505. END
  506. ELSE IF menu='FILE' THEN
  507. DO
  508.     SAY pen6'         _________'def
  509.     SAY pen6'  ______/  'pen3'Files'pen6'  \_______'def
  510.     SAY pen6' |                        |'def
  511.     SAY pen6' |'def'   ['pen3'H'def']elp               'pen6'|'def
  512.     SAY pen6' |'def'   ['pen3'B'def']rowse files       'pen6'|'def
  513.     SAY pen6' |'def'   ['pen3'N'def']ew files list     'pen6'|'def
  514.     SAY pen6' |'def'   ['pen3'L'def']ist files         'pen6'|'def
  515.     SAY pen6' |'def'   ['pen3'S'def']earch files       'pen6'|'def
  516.     SAY pen6' |'def'   ['pen3'V'def']iew textfile      'pen6'|'def
  517.     SAY pen6' |'def'   ['pen3'U'def']pload             'pen6'|'def
  518.     SAY pen6' |'def'   ['pen3'K'def']ill a user        'pen6'|'def
  519.     SAY pen6' |'def'   ['pen3'%'def'] edit filenote    'pen6'|'def
  520.     SAY pen6' |'def'   ['pen3'('def'] file report      'pen6'|'def
  521.     SAY pen6' |'def'   ['pen3'-'def'] edit filecomment 'pen6'|'def
  522.     SAY pen6' |'def'   ['pen3'@'def'] dos shell        'pen6'|'def
  523.     SAY pen6' |'def'   ['pen3'M'def']essages menu      'pen6'|'def
  524.     SAY pen6' |'def'   ['pen3'.'def'] main menu        'pen6'|'def
  525.     SAY pen6' |________________________|'def
  526. END
  527. ELSE IF menu='MAIN' THEN
  528. DO
  529.     SAY pen6'       _____________'def
  530.     SAY pen6'  ____/  'pen3'Main Menu'pen6'  \_____'def
  531.     SAY pen6' |                        |'def
  532.     SAY pen6' |'def'   ['pen3'H'def']elp               'pen6'|'def
  533.     SAY pen6' |'def'   ['pen3'I'def']nfomation         'pen6'|'def
  534.     SAY pen6' |'def'   ['pen3'J'def']ump to doorways   'pen6'|'def
  535.     SAY pen6' |'def'   ['pen3'Y'def']our user data     'pen6'|'def
  536.     SAY pen6' |'def'   ['pen3'W'def']ho is here list   'pen6'|'def
  537.     SAY pen6' |'def'   ['pen3'S'def']earch userlist    'pen6'|'def
  538.     SAY pen6' |'def'   ['pen3'O'def']ther users info   'pen6'|'def
  539.     SAY pen6' |'def'   ['pen3'X'def']pert (no menus)   'pen6'|'def
  540.     SAY pen6' |'def'   ['pen3'#'def'] toggle colors    'pen6'|'def
  541.     SAY pen6' |'def'   ['pen3'$'def'] toggle menu(s)   'pen6'|'def
  542.     SAY pen6' |'def'   ['pen3'Z'def'] bbs statistics   'pen6'|'def
  543.     SAY pen6' |'def'   ['pen3'G'def']oodbye (hangup)   'pen6'|'def
  544.     SAY pen6' |'def'   ['pen3'F'def']iles menu         'pen6'|'def
  545.     SAY pen6' |'def'   ['pen3'M'def']essages menu      'pen6'|'def
  546.     SAY pen6' |________________________|'def
  547. END
  548. ELSE IF menu='ALL' THEN
  549. DO
  550.     SAY pen6'     __________________________________________________________'def
  551.     SAY pen6'  __/   'pen3'Main Menu            File Menu          Message Menu 'pen6'  \__'def
  552.     SAY pen6' |                                                                |'def
  553.     SAY pen6' |'def' ['pen3'H'def']elp               ['pen3'B'def']rowse filenotes   ['pen3'P'def']ost messages      'pen6'|'def
  554.     SAY pen6' |'def' ['pen3'I'def']nfomation         ['pen3'N'def']ew files list     ['pen3'R'def']ead messages      'pen6'|'def
  555.     SAY pen6' |'def' ['pen3'W'def']ho is here list   ['pen3'L'def']ist files         ['pen3'E'def']mail (private)    'pen6'|'def
  556.     SAY pen6' |'def' ['pen3'Y'def']our user data     ['pen3'U'def']pload             ['pen3'C'def']omment to SYSOP   'pen6'|'def
  557.     SAY pen6' |'def' ['pen3'O'def']ther users info   ['pen3'D'def']ownload           ['pen3'!'def'] YELL for SYSOP   'pen6'|'def
  558.     SAY pen6' |'def' ['pen3'J'def']ump to doorways   ['pen3'V'def']iew textfile      ['pen3'X'def']pert (no menus)   'pen6'|'def
  559.     SAY pen6' |'def' ['pen3'S'def']earch menu        ['pen3'T'def']ransfer protocol  ['pen3'$'def'] toggle menu(s)   'pen6'|'def
  560.     SAY pen6' |'def' ['pen3'G'def']oodbye (logoff)   ['pen3'Z'def'] bbs statiZtics   ['pen3'#'def'] toggle colors    'pen6'|'def
  561. IF(level>sysoplevel) THEN DO
  562.     SAY pen6' |'def' ['pen3'K'def']ill a user        ['pen3'%'def'] edit filenote    ['pen3'='def'] level report     'pen6'|'def
  563.     SAY pen6' |'def' ['pen3'^'def'] view BBS logs    ['pen3'('def'] file report      ['pen3')'def'] email report     'pen6'|'def;END
  564. IF(level=99) THEN
  565.     SAY pen6' |'def' ['pen3'@'def'] dos shell        ['pen3'-'def'] edit filecomment ['pen3'&'def'] online editor    'pen6'|'def
  566.     SAY pen6' |________________________________________________________________|'def
  567. END
  568. SAY
  569. RETURN;
  570.  
  571.  
  572. help:
  573. ARG helppath .
  574. SAY
  575. SAY 'For more detailed help, use the ['pen3'I'def']nformation commmand to read HELP.'
  576. IF helppath='MAIN' THEN
  577.   SAY 'Commands available from the' pen3||menu||def 'menu:'
  578. frontend=bbspath'BBS_HELP/'helppath
  579. backend='.USER'
  580. IF level=0 THEN backend='.NEW'
  581. ELSE IF level=99 THEN backend='.SUPER'
  582. ELSE IF level>sysoplevel THEN backend='.SYSOP'
  583. CALL showtext(frontend||backend);
  584. RETURN;
  585.  
  586.  
  587. waiting:
  588. waitchar=''
  589. IF nonstop=1 THEN RETURN;
  590. OPTIONS PROMPT pen3'                       RETURN=Continue  'def
  591. PULL waitchar
  592. CALL cleanline(1);
  593. RETURN;
  594.  
  595.  
  596. cleanline:
  597. ARG lflag .
  598. cline=lineup||LEFT(' ',78)
  599. IF lflag=1 THEN cline=cline||lineup
  600. SAY cline
  601. RETURN;
  602.  
  603.  
  604. getinput:
  605. PARSE ARG upflag' 'oneflag' 'pline
  606. OPTIONS PROMPT pline
  607. PARSE PULL inarg
  608. inarg=STRIP(inarg)
  609. IF upflag THEN inarg=UPPER(inarg)
  610. IF oneflag THEN inarg=LEFT(inarg,1)
  611. RETURN(inarg);
  612.  
  613.  
  614. setdir:
  615. PARSE ARG tempdir
  616. CALL PRAGMA('D',tempdir)
  617. directory=PRAGMA('D')
  618. slash=LASTPOS('/',directory)
  619. IF slash=0 THEN slash=LASTPOS(':',directory)
  620. plaindir=directory
  621. IF slash>0 THEN plaindir=SUBSTR(plaindir,slash+1)
  622. RETURN;
  623.  
  624.  
  625. readlogs:
  626. IF arg='' THEN
  627.   arg=getinput(1 0 '['pen3'RETURN'def']=TODAY, or enter Log Date ('pen3||DATE('S')||def') > ');
  628. IF arg='' THEN arg=DATE('S')
  629. arg=bbspath'Logs/log.'arg
  630. CALL readlines(arg 1);
  631. CALL seelines();
  632. nonstop=0
  633. CALL waiting();
  634. RETURN;
  635.  
  636.  
  637. otheruser:
  638. SAY
  639. SAY 'To allow (or not) other users to see your street address and/or phone number,'
  640. SAY 'add (or delete) STREET and/or PHONE to the line 8 list in ['pen3'Y'def']our userfile.'
  641. SAY
  642. SAY 'User specification may include ? wildcard for single characters.'
  643. SAY 'ie,' pen3's?n'def 'will return all user names containing ''son'', ''sen'', ''sin'', etc.'
  644. IF arg='' THEN arg=getinput(1 0 pen3'User specification: 'def)
  645. IF arg='' THEN RETURN;
  646. arg=TRANSLATE(STRIP(arg),'_',' ')
  647. CALL FileList(bbspath'Users/*'arg'*',wildlist)
  648. line='Found' wildlist.0 'match'
  649. IF wildlist.0~=1 THEN line=line'es'
  650. SAY line'.'
  651. IF wildlist.0<1 THEN RETURN;
  652. totlines=0
  653. nextpagebreak=linesperpage-3
  654. extrainfo=0
  655. IF level>sysoplevel THEN
  656.   DO
  657.     IF getinput(1 1 'Display -sysop only- information? (nY) > ')~='N' THEN
  658.       extrainfo=1
  659.   END
  660. DO i=1 TO wildlist.0
  661.   CALL readlines(wildlist.i 1)
  662.   SAY 
  663.   totlines=totlines+4
  664.   SAY lynes.1
  665.   IF FIND(UPPER(lynes.8),'STREET')>0 THEN
  666.     DO
  667.       totlines=totlines+1
  668.       SAY lynes.2
  669.     END
  670.   SAY lynes.3
  671.   IF FIND(UPPER(lynes.8),'PHONE')>0 THEN
  672.     DO
  673.       totlines=totlines+1
  674.       SAY lynes.4
  675.     END
  676.   SAY 'Last time on' bbsname':' DATE(,WORD(lynes.13,1),'S') WORD(lynes.13,2)
  677.   SAY pen3'Interests:'def lynes.10
  678.   IF extrainfo THEN
  679.     DO
  680.       SAY pen3'   up:'def lynes.14
  681.       SAY pen3' down:'def lynes.15
  682.       temptot=0
  683.       DO j=1 TO WORDS(lynes.23)
  684.         IF DATATYPE(WORD(lynes.23,j),'N') THEN temptot=temptot+WORD(lynes.23,j)
  685.       END
  686.       SAY pen3' writ:'def temptot 'public messages.'
  687.       SAY pen3'level:'def lynes.20
  688.       totlines=totlines+4
  689.       IF lynes.21~='' THEN
  690.         DO
  691.           totlines=totlines+1
  692.           SAY pen3'excluded dirs:'def lynes.21
  693.         END
  694.     END
  695.   IF totlines>=nextpagebreak THEN
  696.     DO
  697.       CALL waiting();
  698.       nextpagebreak=totlines+linesperpage-3
  699.     END
  700. END
  701. CALL waiting();
  702. RETURN;
  703.  
  704.  
  705. levelreport:
  706. DO i=1 TO WORDS(userlist)
  707.   arg=bbspath'Users/'WORD(userlist,i)
  708.   CALL readlines(arg 1)
  709.   line=lynes.20 WORD(userlist,i)
  710.   SAY line
  711.   IF ~DATATYPE(WORD(lynes.20,1),'N') | WORD(lynes.20,1)=0 THEN
  712.     DO
  713.       temp=getinput(1 1 '[A]dd or [K]ill this user? (kA) > ');
  714.       IF temp='K' THEN
  715.         DO
  716.           arg=WORD(userlist,i)
  717.           CALL killuser();
  718.           CALL cleanline();
  719.         END
  720.       ELSE
  721.         DO
  722.           IF readopen(bbspath'BBS_TEXT/DEF.MEMBER') THEN
  723.             DO
  724.               DO lvi=1 TO 21
  725.                 line=READLN(f)
  726.                 IF lvi=11 THEN lynes.11=line
  727.                 IF lvi=20 THEN lynes.20=line
  728.               END
  729.               lynes.21=line
  730.               CALL CLOSE(f)
  731.               edtype=''
  732.               CALL savelines(arg);
  733.             END
  734.           ELSE SAY 'You need a default member file in BBS_TEXT!   ( BBS_TEXT/DEF.MEMBER )'
  735.         END
  736.     END
  737.   IF i//linesperpage=0 THEN CALL waiting();
  738. END
  739. RETURN;
  740.  
  741.  
  742. filereport:
  743. IF getinput(1 1 'Check against filelist? (yN) > ')='Y' THEN dokk=1
  744. ELSE dokk=0
  745. SAY 'Searching for mismatches between files and filenotes...'
  746. kk=countcheck(bbspath'Numbers/LastFile')
  747. DO i=1 TO sysoplevel+1
  748.   IF dirs.i='' THEN ITERATE
  749.   SAY dirs.i'                               'lineup
  750.   rfiles=SHOWDIR(libpath||dirs.i)
  751.   rnotes=SHOWDIR(bbspath'FileNotes/'dirs.i)
  752.   IF WORDS(rfiles)~=WORDS(rnotes) THEN
  753.     DO
  754.       line='Compare files & filenotes in'pen3 dirs.i||def'. '
  755.       DO j=1 TO WORDS(rfiles)
  756.         IF FIND(UPPER(rnotes),UPPER(WORD(rfiles,j)))=0 THEN
  757.           line=line WORD(rfiles,j)
  758.       END
  759.       SAY line
  760.     END
  761.   DO j=1 TO WORDS(rfiles) WHILE dokk
  762.     DO k=1 TO kk
  763.       IF files.k='' THEN ITERATE k
  764.       IF UPPER(WORD(rfiles,j))=UPPER(WORD(files.k,2)) THEN ITERATE j
  765.     END
  766.     SAY WORD(rfiles,j) 'is not on the filelist.'
  767.   END
  768. END
  769. SAY '07'x
  770. CALL waiting();
  771. RETURN;
  772.  
  773.  
  774. mailreport:
  775. SAY 'Searching for ALL pending Email...'
  776. SAY pen3' - Use CTRL-E to Exit -'def
  777. mailrep=SHOWDIR(bbspath'Email')
  778. mailfil=SHOWDIR(bbspath'EmailFiles')
  779. emailnum=0
  780. lastemail=WORD(data.17,3)
  781. IF ~DATATYPE(lastemail,'N') THEN lastemail=0
  782. mailynes.=''
  783. mk=0
  784. DO mi=1 TO WORDS(mailrep)
  785.   muser=WORD(mailrep,mi)
  786.   mlist=SHOWDIR(bbspath'Email/'muser)
  787.   DO mj=1 TO WORDS(mlist)
  788.     fuser=WORD(mlist,mj)
  789.     mk=mk+1
  790.     mailynes.mk=pen3||LEFT(muser,20) 'from'def LEFT(fuser,20) DATE(,WORD(STATEF(bbspath'Email/'muser'/'fuser),5),'I')
  791.     IF POS(sysop,fuser)=0 & POS(name,fuser)=0 THEN
  792.       DO
  793.         testnum=RIGHT(fuser,LENGTH(fuser)-LASTPOS('.',fuser))
  794.         IF testnum>emailnum THEN emailnum=testnum
  795.         IF testnum>lastemail THEN CALL showtext(bbspath'Email/'muser'/'fuser);
  796.       END
  797.   END
  798.   IF FIND(mailfil,muser)>0 THEN
  799.     DO
  800.       efilelist=SHOWDIR(bbspath'EmailFiles/'muser)
  801.       IF WORDS(efilelist)>0 THEN
  802.         DO
  803.           mk=mk+1
  804.           mailynes.mk=pen3||LEFT(muser,20) 'emailfiles'def efilelist
  805.         END
  806.     END
  807. END
  808. data.17=WORD(data.17,1) WORD(data.17,2) emailnum
  809. IF mk>0 THEN
  810.   DO
  811.     lynes.0=mk
  812.     DO mi=1 TO mk
  813.       lynes.mi=mailynes.mi
  814.     END
  815.     CALL seelines();
  816.     nonstop=0
  817.     CALL waiting();
  818.   END
  819. ELSE SAY 'No Email pending.'
  820. RETURN;
  821.  
  822.  
  823. jump2rexx:
  824. IF ~DATATYPE(jdoors.0,'N') THEN
  825.   DO
  826.     jdoors.=''
  827.     doorlist=SHOWDIR(bbspath'rexxDoors','F')
  828.     doors.=''
  829.     doors.0=WORDS(doorlist)
  830.     DO i=1 TO doors.0
  831.       doors.i=WORD(doorlist,i)
  832.     END
  833.     SAY 'Sorting..'lineup
  834.     CALL QSORT(1,doors.0,doors)
  835.     jdoors.0=doors.0%3
  836.     IF (doors.0//3)>0 THEN jdoors.0=jdoors.0+1
  837.     DO i=1 TO jdoors.0
  838.       jdoors.i=LEFT(RIGHT(i,3)'.' LEFT(doors.i,LENGTH(doors.i)-5),24)
  839.       DO j=1 TO 2
  840.         k=i+j*jdoors.0
  841.         IF k<=doors.0 THEN
  842.           jdoors.i=jdoors.i' 'LEFT(RIGHT(k,3)'.' LEFT(doors.k,LENGTH(doors.k)-5),24)
  843.       END
  844.     END
  845.   END
  846. DO doorloop=1
  847.   SAY pen3||LEFT('-',75,'-')||def
  848.   DO jd=1 TO jdoors.0
  849.     SAY jdoors.jd
  850.     IF jd//linesperpage=0 THEN CALL waiting();
  851.     IF waitchar='Q' THEN RETURN;
  852.   END
  853.   temp=getinput(1 0 pen3'Select Application Number > 'def);
  854.   IF ~DATATYPE(temp,'N') | temp<1 | temp>doors.0 THEN RETURN;
  855.   curdir=PRAGMA('D')
  856.   CALL setdir(bbspath'rexxDoors');
  857.   CALL SETCLIP('BBS_winnings')
  858.   savewinnings=0
  859.   IF UPPER(doors.temp)='ONE_ARMED_BANDIT.REXX' THEN
  860.     IF getinput(1 1 'Play for this sessions time in seconds? (yN) > ')='Y' THEN
  861.       DO
  862.         savewinnings=winnings
  863.         winnings=TRUNC(maxtime-TIME('E'))
  864.         SAY 'Playing for REAL seconds, not wimpy play-dollars!'
  865.       END
  866.   INTERPRET 'call' doors.temp'('name winnings savewinnings')'
  867.   testwin=GETCLIP('BBS_winnings')
  868.   IF DATATYPE(testwin,'N') THEN
  869.     DO
  870.       IF testwin>7200 THEN
  871.         DO
  872.           SAY 'Although you won' TRUNC(testwin/60) 'minutes, the maximum session time is 120 minutes.'
  873.           testwin=7200
  874.         END
  875.       winnings=testwin
  876.       IF savewinnings>0 THEN
  877.         DO
  878.           maxtime=TRUNC(testwin+TIME('E'))
  879.           winnings=savewinnings
  880.         END
  881.     END
  882.   CALL setdir(curdir);
  883.   CALL SETCLIP('BBS_winnings')
  884. END
  885. RETURN;
  886.  
  887.  
  888. sortlibraries:
  889. SAY 'Sorting Libraries...'lineup
  890. count=0
  891. sdirs.=''
  892. DO i=1 TO level
  893.   IF dirs.i='' THEN ITERATE i
  894.   count=count+1
  895.   sdirs.count=dirs.i i
  896. END
  897. sdirs.0=count
  898. CALL QSort(1,count,sdirs);
  899. count=0
  900. libs.=''
  901. DO i=1 TO sdirs.0
  902.   tempnum=WORD(sdirs.i,2)
  903.   tempdir=WORD(sdirs.i,1)
  904.   IF FIND(UPPER(data.21),UPPER(tempdir))=0 THEN
  905.     DO
  906.       string=' '
  907.       IF tempnum<10 THEN string=string' '
  908.       string=string || tempnum'. 'LEFT(tempdir,14)
  909.       count=count+1
  910.       libs.count=string
  911.     END
  912. END
  913. libs.0=count%4
  914. IF (count//4)>0 THEN libs.0=libs.0+1
  915. DO i=1 TO libs.0
  916.   DO j=1 TO 3
  917.     k=i+j*libs.0
  918.     IF k<=count THEN libs.i=libs.i libs.k
  919.   END
  920. END
  921. CALL sortconferences();
  922. RETURN;
  923.  
  924.  
  925. sortconferences:
  926. SAY 'Sorting Conferences...'lineup
  927. count=0
  928. smsg.=''
  929. DO i=1 TO level
  930.   IF msg.i='' THEN ITERATE i
  931.   count=count+1
  932.   smsg.count=msg.i i
  933. END
  934. smsg.0=count
  935. CALL QSort(1,count,smsg);
  936. count=0
  937. msgs.=''
  938. DO i=1 TO smsg.0
  939.   tempnum=WORD(smsg.i,2)
  940.   tempdir=WORD(smsg.i,1)
  941.   IF FIND(UPPER(data.21),tempnum)=0 THEN
  942.     DO
  943.       string=' '
  944.       IF tempnum<10 THEN string=string' '
  945.       string=string || tempnum'.'
  946.       IF WORD(data.22,tempnum)='' | WORD(data.22,tempnum)>=0 THEN
  947.         string=string LEFT(tempdir,20)
  948.       ELSE string=string pen3'-OFF-'def LEFT(tempdir,14)
  949.       count=count+1
  950.       msgs.count=string
  951.     END
  952. END
  953. msgs.0=count%3
  954. IF (count//3)>0 THEN msgs.0=msgs.0+1
  955. DO i=1 TO msgs.0
  956.   DO j=1 TO 2
  957.     k=i+j*msgs.0
  958.     IF k<=count THEN msgs.i=msgs.i msgs.k
  959.   END
  960. END
  961. RETURN;
  962.  
  963.  
  964. readmessages:
  965. DO FOREVER
  966.   SAY 
  967.   IF DATATYPE(arg,'N') THEN msgdir=arg
  968.   ELSE IF LEFT(UPPER(arg),1)='A' THEN
  969.     DO
  970.       CALL newmsgs();
  971.       RETURN;
  972.     END
  973.   ELSE
  974.     DO
  975.       SAY 'Select Message Conference By Number or ['pen3'A'def']ll Active'
  976.       IF areaselect() THEN
  977.         DO
  978.           IF LEFT(temp,1)='A' THEN CALL newmsgs();
  979.           waitchar=temp
  980.           RETURN;
  981.         END
  982.     END
  983.   junk=getinput(1 1 '['pen3'M'def']ask ON/OFF  ['pen3'R'def']ead  ['pen3'Q'def']uit (Rmq) > ')
  984.   IF junk='Q' THEN RETURN;
  985.   IF junk='M' THEN
  986.     DO
  987.       line='Turning the' msg.msgdir 'conference'
  988.       IF WORD(data.22,msgdir)<0 THEN
  989.         DO
  990.           line=line pen3'ON'def'.'
  991.           newdata='0'
  992.         END
  993.       ELSE
  994.         DO
  995.           line=line pen3'OFF'def'.'
  996.           newdata='-1'
  997.         END
  998.       SAY line
  999.       dataloc=WORDINDEX(data.22,msgdir)-1
  1000.       data.22=DELWORD(data.22,msgdir,1)
  1001.       data.22=INSERT(newdata' ',data.22,dataloc)
  1002.       CALL sortconferences();
  1003.     END
  1004.   CALL readmsg(0);
  1005.   CALL saveData(1);
  1006.   nonstop=0
  1007.   arg=''
  1008. END
  1009. RETURN;
  1010.  
  1011.  
  1012. newmsgs:
  1013. curmsgdir=msgdir
  1014. SAY 'Scanning all Conferences for new messages..'
  1015. DO newi=1 TO level
  1016.   IF newi>level THEN LEAVE newi
  1017.   IF msg.newi='' THEN ITERATE newi
  1018.   msgdir=newi
  1019.   CALL readmsg(1);
  1020.   IF msgcom='Q' THEN LEAVE newi
  1021. END
  1022. CALL saveData(1);
  1023. msgdir=curmsgdir
  1024. nonstop=0
  1025. RETURN;
  1026.  
  1027.  
  1028. readmsg:
  1029. ARG quietflag
  1030. IF msg.msgdir='' | FIND(data.21,msgdir)>0 THEN RETURN;   /* sysop excluded */
  1031. IF WORD(data.22,msgdir)=-1 THEN RETURN;  /*  user excluded */
  1032. IF quietflag=0 THEN SAY 'Entering' msg.msgdir 'Message Conference..'
  1033. IF DATATYPE(WORD(data.22,msgdir),'N') THEN
  1034.   lastread.msgdir=WORD(data.22,msgdir)
  1035. ELSE lastread.msgdir=0
  1036. lstwrt=countcheck(bbspath'Numbers/LastMessage'msgdir 0)
  1037. temp=''
  1038. IF lastread.msgdir>=lstwrt THEN
  1039.   DO
  1040.     lastread.msgdir=lstwrt
  1041.     CALL msgcount(msgdir);
  1042.     IF quietflag=1 THEN RETURN;
  1043.     temp=getinput(1 0 pen3'Enter starting message number > 'def);
  1044.     IF ~DATATYPE(temp,'N') THEN RETURN;
  1045.     IF temp<1 THEN temp=1
  1046.     lastread.msgdir=temp-1
  1047.   END
  1048. dirname=msgpath||msgdir
  1049. testlist=sortnumbers(SHOWDIR(dirname));
  1050. msglist.=0                /* set read to 0, unread to 1, and reply >=2 */
  1051. DO i=1 TO WORDS(testlist)
  1052.   test=WORD(testlist,i)
  1053.   IF test>lastread.msgdir THEN msglist.test=1
  1054. END
  1055. msgstatus=1
  1056. IF temp='' THEN CALL msgcount(msgdir);
  1057. DO msgloop=1 WHILE lastread.msgdir<lstwrt
  1058.   lastreadnum=lastread.msgdir
  1059.   DO WHILE msglist.lastreadnum=0 & lastreadnum<lstwrt
  1060.     lastreadnum=lastreadnum+1
  1061.   END
  1062.   lastread.msgdir=lastreadnum
  1063.   DO mess=lastread.msgdir TO lstwrt+1
  1064.     IF msglist.mess~=msgstatus THEN ITERATE mess
  1065.     IF mess>lstwrt THEN RETURN;
  1066.     IF msgstatus>1 THEN SAY 'Following the thread, level' msgstatus-1'.'
  1067.     msglist.mess=0
  1068.     arg=dirname'/'mess
  1069.     IF ~EXISTS(arg) THEN
  1070.       DO
  1071.         SAY 'Message number' mess 'is missing.'
  1072.         ITERATE mess
  1073.       END
  1074.     IF ~readopen(arg) THEN ITERATE mess
  1075.     firstline  = READLN(f)
  1076.     secondline = READLN(f)
  1077.     thirdline  = READLN(f)
  1078.     forthline  = READLN(f)
  1079.     CALL CLOSE(f)
  1080.     CALL killmark(msgdir mess)
  1081.     CALL DELAY(28)
  1082.     IF WORDS(firstline)>2 THEN  /* if replies, change their num to 2 */
  1083.       DO
  1084.         thread=SUBSTR(firstline,WORDINDEX(firstline,4))
  1085.         DO tindx=1 TO WORDS(thread)
  1086.           test=WORD(thread,tindx)
  1087.           IF msglist.test~=0 THEN msglist.test=msgstatus+1
  1088.         END
  1089.       END
  1090.     savearg=arg
  1091.     msgcom='A'
  1092.     DO msgloop2=1 WHILE msgcom='A' | msgcom='O'
  1093.       CALL readlines(arg 1);
  1094.       IF nonstop=1 THEN rnonstop=1
  1095.       ELSE rnonstop=0
  1096.       CALL seelines();
  1097.       msgcom=''
  1098.       IF rnonstop THEN
  1099.         DO
  1100.           SAY
  1101.           nonstop=1
  1102.           msgcom=''
  1103.         END
  1104.       ELSE
  1105.         DO
  1106.           pline='['pen3'A'def']gain ['pen3'H'def']elp'
  1107.           IF level>sysoplevel | name=WORD(lynes.2,2) THEN
  1108.             pline=pline '['pen3'E'def']dit ['pen3'K'def']ill'
  1109.           IF WORDS(lynes.3)>3 THEN pline=pline '['pen3'O'def']riginal'
  1110.           pline=pline '['pen3'N'def']onStop ['pen3'R'def']eply'
  1111.           pline=pline '['pen3'S'def']kip ['pen3'Q'def']uit'
  1112.           msgcom=getinput(1 0 pline' > ');
  1113.           CALL cleanline(0);
  1114.         END
  1115.       IF DATATYPE(msgcom,'N') & EXISTS(dirname'/'msgcom) THEN
  1116.         DO
  1117.           arg=dirname'/'msgcom
  1118.           msgcom='A'
  1119.           ITERATE msgloop2
  1120.         END
  1121.       ELSE msgcom=LEFT(msgcom,1)
  1122.       IF msgcom='Q' THEN LEAVE msgloop
  1123.       ELSE IF msgcom='A' THEN ITERATE msgloop2
  1124.       ELSE IF msgcom='N' THEN
  1125.         DO
  1126.           nonstop=1
  1127.           msgcom=''
  1128.         END
  1129.       ELSE IF msgcom='H' THEN
  1130.         DO
  1131.           SAY pen3' - HELP with the Read Messages commands -'def
  1132.           SAY ' RETURN reads the next message in line.'
  1133.           SAY ' 34 will read message number 34, if it exists in this conference.'
  1134.           SAY ' A  reads this message Again (in case it scrolled off screen).'
  1135.           IF level>sysoplevel | name=WORD(lynes.2,2) THEN
  1136.             DO
  1137.           SAY ' E  puts this message into the online Editor.'
  1138.           SAY ' K  deletes a message you wrote. you cannot Kill others!'
  1139.             END
  1140.           SAY ' N  displays all new messages without pausing. CTRL-E to Exit!'
  1141.           SAY ' O  if this message is a reply, will read the Original message.'
  1142.           SAY ' R  enters the message editor to Reply to this message.'
  1143.           SAY ' S  allows you to Skip threads or conferences.'
  1144.           SAY ' Q  returns to the message menu. (Quit)'
  1145.           SAY
  1146.           CALL waiting();
  1147.           msgcom='A'
  1148.           IF waitchar='Q' THEN LEAVE msgloop
  1149.         END
  1150.       ELSE IF msgcom='E' THEN
  1151.         DO
  1152.           IF level>sysoplevel | name=WORD(lynes.2,2) THEN
  1153.             DO
  1154.               sline=7
  1155.               IF level>sysoplevel THEN sline=1
  1156.               CALL bbsED(sline arg);
  1157.               msgcom='A'
  1158.             END
  1159.         END
  1160.       ELSE IF msgcom='S' THEN
  1161.         DO
  1162.           stemp=getinput(1 1 'Skip this ['pen3'T'def']hread or the entire ['pen3'C'def']onference (tc) > ');
  1163.           IF stemp='T' THEN
  1164.             DO
  1165.               SAY 'Skipping this message AND its replies..'
  1166.               DO i=lastread.msgdir TO lstwrt
  1167.                 IF msglist.i>1 THEN msglist.i=0
  1168.               END
  1169.             END
  1170.           ELSE IF stemp='C' THEN
  1171.             DO
  1172.               SAY 'Skipping to the last message in the' msg.msgdir 'conference.'
  1173.               lastread.msgdir=lstwrt-1
  1174.               lw=lstwrt-1
  1175.               msglist.lw=0
  1176.               msglist.lstwrt=1
  1177.               LEAVE mess
  1178.             END
  1179.         END
  1180.       ELSE IF msgcom='K' THEN
  1181.         DO
  1182.           IF level>sysoplevel | name=WORD(lynes.2,2) THEN
  1183.             DO
  1184.               IF getinput(1 1 'Really delete' arg'? (yN) > ')='Y' THEN
  1185.                 DO
  1186.                   CALL DELETE(arg)
  1187.                   SAY pen3||arg||def' has been deleted.'
  1188.                 END
  1189.             END
  1190.         END
  1191.       ELSE IF msgcom='O' THEN   /* go back and read original */
  1192.         DO
  1193.           IF WORDS(lynes.3)>3 THEN
  1194.             DO
  1195.               temp=WORD(lynes.3,4)
  1196.               arg=dirname'/'temp
  1197.             END
  1198.           ELSE SAY 'This is the original message.'
  1199.         END
  1200.       ELSE IF msgcom='R' THEN        /*  toname     msgnum  */
  1201.         DO
  1202.           msgnum=WORD(lynes.1,2)
  1203.           IF editor('REPLY' WORD(lynes.2,2) msgnum) THEN /* reply */
  1204.             DO
  1205.               savearg2=arg
  1206.               arg=dirname'/'WORD(lynes.3,4)
  1207.               IF EXISTS(arg) THEN
  1208.                 DO
  1209.                   IF readlines(arg 1) THEN BREAK;
  1210.                   xmsg=countcheck(bbspath'Numbers/LastMessage'msgdir mess)
  1211.                   IF WORDS(lynes.1)>3 THEN lynes.1=lynes.1 xmsg
  1212.                   ELSE lynes.1=lynes.1'   Reply' xmsg
  1213.                   CALL DELAY(28)    /* allow 1/2 sec for read to close */
  1214.                   IF savelines(arg) THEN RETURN;
  1215.                 END
  1216.               arg=savearg2
  1217.             END
  1218.         END
  1219.       ELSE IF arg~=savearg THEN    /* Continue */
  1220.         DO
  1221.           msgcom='A'
  1222.           arg=savearg
  1223.         END
  1224.     END
  1225.     IF thread~='' THEN
  1226.       DO
  1227.         thread=''
  1228.         msgstatus=msgstatus+1
  1229.       END
  1230.   END
  1231.   IF msgstatus>1 THEN msgstatus=msgstatus-1
  1232. END
  1233. waitchar=''
  1234. nonstop=0
  1235. RETURN;
  1236.  
  1237.  
  1238. showmarked:
  1239. IF WORDS(data.24)<1 THEN RETURN;
  1240. SAY
  1241. SAY pen3'These unread conference messages are addressed to you:'def
  1242. DO i=1 TO WORDS(data.24)
  1243.   tempk=WORD(data.24,i)
  1244.   PARSE VAR tempk kdir'/'kmsg
  1245.   SAY RIGHT(kmsg,6) 'in the' msg.kdir 'conference.'
  1246. END
  1247. CALL waiting();
  1248. SAY
  1249. RETURN;
  1250.  
  1251.  
  1252. killmark:
  1253. PARSE ARG kdir kmsg .
  1254. markword=FIND(data.24,kdir'/'kmsg)
  1255. IF markword>0 THEN data.24=STRIP(DELWORD(data.24,markword,1))
  1256. RETURN;
  1257.  
  1258.  
  1259. sortnumbers:
  1260. PARSE ARG slist
  1261. sorted.=''
  1262. newest=0
  1263. newlist=''
  1264. DO si=1 TO WORDS(slist)
  1265.   tempnum=WORD(slist,si)/1
  1266.   sorted.tempnum=1
  1267.   IF tempnum>newest THEN newest=tempnum
  1268. END
  1269. DO si=1 TO newest
  1270.   IF sorted.si~=1 THEN ITERATE si
  1271.   newlist=newlist si
  1272. END
  1273. RETURN(STRIP(newlist));
  1274.  
  1275.  
  1276. readmail:
  1277. ARG fromenu .
  1278. replysubj=''
  1279. IF fromenu THEN
  1280.   DO
  1281.     temp=UPPER(arg)
  1282.     arg=''
  1283.     IF temp~='F' & temp~='T' & temp~='W' THEN
  1284.       DO
  1285.         line='Find Email ['pen3'F'def']rom You ['pen3'T'def']o You or ['pen3'W'def']rite New Email (ftw) > 'def
  1286.         temp=getinput(1 1 line);
  1287.         CALL cleanline(0);
  1288.       END
  1289.     IF temp='W' THEN
  1290.       DO
  1291.         CALL editor('MAIL');
  1292.         RETURN;
  1293.       END
  1294.     ELSE IF temp='F' THEN
  1295.       DO
  1296.         SAY pen3'You have Email pending to the following users:'def
  1297.         firsteditline=0
  1298.         picklist.=''
  1299.         picklist.0=0
  1300.         DO ei=1 TO WORDS(userlist)
  1301.           fmaillist=SHOWDIR(bbspath'EMail/'WORD(userlist,ei))
  1302.           DO ej=1 TO WORDS(fmaillist)
  1303.             ejname=WORD(fmaillist,ej)
  1304.             uname=ejname
  1305.             caret=LASTPOS('.',uname)
  1306.             IF caret>2 THEN uname=LEFT(uname,caret-1)
  1307.             IF uname=name THEN
  1308.               DO
  1309.                 arg=bbspath'EMail/'WORD(userlist,ei)'/'ejname
  1310.                 IF EXISTS(arg) THEN
  1311.                   DO
  1312.                     pklst=picklist.0+1
  1313.                     picklist.pklst=WORD(userlist,ei)
  1314.                     picklist.pklst.0=ejname
  1315.                     picklist.0=pklst
  1316.                   END
  1317.               END
  1318.           END
  1319.         END
  1320.         IF picklist.0=0 THEN SAY lineup'No Email FROM you was found.                    '
  1321.         ELSE
  1322.           DO
  1323.             pickcheck=1
  1324.             DO WHILE pickcheck~=0
  1325.               pickcheck=pickfromlist();
  1326.               IF pickcheck~=0 THEN
  1327.                 DO
  1328.                   firsteditline=5
  1329.                   IF level>sysoplevel THEN firsteditline=1
  1330.                   CALL bbsED(firsteditline bbspath'Email/'picklist.pickcheck'/'picklist.pickcheck.0);
  1331.                 END
  1332.             END
  1333.           END
  1334.         RETURN;
  1335.       END
  1336.     ELSE IF temp='T' THEN BREAK;
  1337.     ELSE RETURN;
  1338.   END
  1339. SAY 'Checking your mailbox..'
  1340. nomail=1
  1341. CALL MAKEDIR(bbspath'EMail/'name)
  1342. mailist=SHOWDIR(bbspath'Email/'name)
  1343. IF WORDS(mailist)>0 THEN
  1344.   DO
  1345.     line=WORDS(mailist)
  1346.     IF line>1 THEN line=line 'letters'
  1347.     ELSE line=line 'letter'
  1348.     line=line 'waiting.'
  1349.     SAY line
  1350.     DO ii=1 TO WORDS(mailist)
  1351.       SAY 'Email:' pen3||WORD(mailist,ii)||def
  1352.     END
  1353.     IF ~fromenu THEN
  1354.       IF getinput(1 1 'Read your private mail now? (nY) > ')='N' THEN RETURN;
  1355.   END
  1356. DO letter=1 TO WORDS(mailist)
  1357.   readname=WORD(mailist,letter)
  1358.   uname=readname
  1359.   caret=LASTPOS('.',uname)
  1360.   IF caret>2 THEN uname=LEFT(uname,caret-1)
  1361.   arg=bbspath'Email/'name'/'readname                       /* user has mail! */
  1362.   CALL readlines(arg 1)
  1363.   CALL seelines();
  1364.   nomail=0
  1365.   nonstop=0
  1366.   mailfile=''
  1367.   IF readname~='NEW_USERS' & readname~='NEW_FILES' & WORDS(lynes.2)>3 THEN
  1368.     DO
  1369.       mailfile=WORD(lynes.2,4)
  1370.       curdir=PRAGMA('D')
  1371.       CALL setdir(bbspath'EmailFiles/'name)
  1372.       ADDRESS COMMAND 'List >*' mailfile 'DATES'
  1373.       SAY ' Attached file:' pen3||mailfile||def
  1374.       junk=getinput(1 1 'Leave file in your EmailFiles? (yN) > ');
  1375.       IF junk='Y' THEN mailfile=''
  1376.       ELSE
  1377.         DO
  1378.           junk=getinput(1 1 'Deleting Mail will also delete file. Copy somewhere now? (yN) > ');
  1379.           IF junk='Y' THEN
  1380.             DO
  1381.               savearg=arg
  1382.               arg=mailfile
  1383.               CALL dload();
  1384.               arg=savearg
  1385.             END
  1386.             CALL setdir(curdir)
  1387.         END
  1388.     END
  1389.   IF readname~='NEW_USERS' & readname~='NEW_FILES' THEN
  1390.     DO
  1391.       IF getinput(1 1 'Reply to this message? (nY) > ')~='N' THEN
  1392.         DO
  1393.           replysubj=SUBSTR(lynes.4,WORDINDEX(lynes.4,2))
  1394.           CALL editor('MAIL' uname);
  1395.           replysubj=''
  1396.         END
  1397.     END
  1398.   junk=getinput(1 1 'Forward mail from'pen3 uname def'to other users? (yN) > ');
  1399.   IF junk='Y' THEN
  1400.     DO
  1401.       IF selectchosen(1 pen3'Forward Email To:'def) THEN BREAK;
  1402.       DO ei=1 TO thechosen.0
  1403.         CALL MAKEDIR(bbspath'EMail/'thechosen.ei)
  1404.         forwardarg=bbspath'Email/'thechosen.ei'/'readname
  1405.         ADDRESS COMMAND 'COPY' bbspath'Email/'name'/'readname forwardarg
  1406.         CALL readlines(forwardarg 1);
  1407.         lynes.1=lynes.1'  Forwarded to you by' name TIME('C') DATE()
  1408.         CALL DELETE(forwardarg)
  1409.         CALL savelines(forwardarg);
  1410.         IF WORDS(lynes.2)>3 THEN
  1411.           DO
  1412.             forname=bbspath'EmailFiles/'name'/'WORD(lynes.2,4)
  1413.             IF EXISTS(forname) THEN
  1414.               DO
  1415.                 CALL MAKEDIR(bbspath'EmailFiles/'thechosen.ei)
  1416.                 ADDRESS COMMAND 'COPY' forname bbspath'EmailFiles/'thechosen.ei
  1417.               END
  1418.           END
  1419.         line='Mail' pen3||readname||def 'forwarded to' pen3||thechosen.ei||def
  1420.         SAY line
  1421.       END
  1422.     END
  1423.   IF getinput(1 1 'Delete the mail from'pen3 uname def'you just read? (nY) > 'def)~='N' THEN
  1424.     DO
  1425.       dirname=bbspath'Email/'name'/'
  1426.       CALL DELETE(dirname||readname)
  1427.       tempstr='Mail'
  1428.       IF mailfile~='' & readname~='NEW_USERS' & readname~='NEW_FILES' & EXISTS(bbspath'EmailFiles/'name'/'mailfile) THEN
  1429.         DO
  1430.           CALL DELETE(bbspath'EmailFiles/'name'/'mailfile)
  1431.           tempstr=tempstr 'and attached file'
  1432.         END
  1433.       tempstr=tempstr 'deleted. Thank you for keeping a clean BBS!'def
  1434.       SAY tempstr
  1435.     END
  1436.   ELSE IF readname~='NEW_USERS' & readname~='NEW_FILES' THEN
  1437.     DO
  1438.       arg=bbspath'Email/'name'/'readname
  1439.       CALL readlines(arg 1)
  1440.       IF WORDS(lynes.3)<3 THEN
  1441.         DO
  1442.           lynes.3=lynes.3'  (R)'     /* received */
  1443.           CALL DELETE(arg)
  1444.           CALL savelines(arg)
  1445.           SAY 'Email has been marked as received.'
  1446.         END
  1447.     END
  1448.   readname=''
  1449.   uname=''
  1450.   arg=''
  1451. END
  1452. IF nomail THEN
  1453.   DO
  1454.     SAY 'No mail was found.'
  1455.     CALL waiting();
  1456.   END
  1457. CALL setdir(libpath||dirs.1);
  1458. thechosen.=''
  1459. RETURN;
  1460.  
  1461.  
  1462. selectchosen:
  1463. PARSE ARG startat selectline
  1464. IF startat<2 THEN thechosen.=''
  1465. line='Enter list of comma separated user names'
  1466. IF level>sysoplevel THEN line=line 'or ALL'
  1467. SAY line
  1468. thechosen.startat=getinput(1 0 selectline);
  1469. IF STRIP(thechosen.startat)='' THEN RETURN(1);
  1470. thechosen.startat=SPACE(thechosen.startat,1,'_')
  1471. thechosen.0=startat
  1472. IF level>sysoplevel & thechosen.startat='ALL' THEN
  1473.   thechosen.startat=SHOWDIR(bbspath'Users',,',')
  1474. IF POS(',',thechosen.startat)>0 THEN
  1475.   DO
  1476.     temp=TRANSLATE(thechosen.startat,' ',',')
  1477.     thechosen.0=WORDS(temp)+startat-1
  1478.     DO ei=startat TO thechosen.0
  1479.       thechosen.ei=WORD(temp,ei)
  1480.     END
  1481.   END
  1482. DO ei=startat TO thechosen.0
  1483.   DO WHILE FIND(userlist,thechosen.ei)=0
  1484.     CALL showuserlist();
  1485.     SAY thechosen.ei 'not found! Enter that name again or press RETURN.'
  1486.     thechosen.ei=getinput(1 0 pen3'Forward Email To: 'def);
  1487.     thechosen.ei=SPACE(thechosen.ei,1,'_')
  1488.     IF thechosen.ei='' THEN ITERATE ei
  1489.   END
  1490. END
  1491. RETURN(0);
  1492.  
  1493.  
  1494. countcheck:
  1495. PARSE ARG fname' 'cknum' '.
  1496. IF ~EXISTS(fname) THEN
  1497.   DO
  1498.     IF ~writeopen(fname) THEN RETURN(0);
  1499.     CALL WRITELN(f,cknum)
  1500.     CALL CLOSE(f)
  1501.     RETURN(cknum);
  1502.   END
  1503. IF ~readopen(fname) THEN RETURN(cknum);
  1504. retval=STRIP(READLN(f))
  1505. CALL CLOSE(f)
  1506. IF ~DATATYPE(retval,'N') THEN retval=0
  1507. IF ~DATATYPE(cknum,'N') THEN cknum=0
  1508. IF retval<cknum THEN
  1509.   DO
  1510.     IF writeopen(fname) THEN
  1511.       DO
  1512.         CALL WRITELN(f,cknum)
  1513.         CALL CLOSE(f)
  1514.         RETURN(cknum);
  1515.       END
  1516.   END
  1517. RETURN(retval);
  1518.  
  1519.  
  1520. pickfromlist:
  1521. DO pfl=1 TO picklist.0 BY 3
  1522.   pfl2=pfl+1
  1523.   pfl3=pfl+2
  1524.   pfline=pen3||RIGHT(pfl,2)||def LEFT(picklist.pfl,20)
  1525.   IF picklist.pfl2~='' THEN
  1526.     pfline=pfline pen3||RIGHT(pfl2,2)||def LEFT(picklist.pfl2,20)
  1527.   IF picklist.pfl3~='' THEN
  1528.     pfline=pfline pen3||RIGHT(pfl3,2)||def LEFT(picklist.pfl3,20)
  1529.   SAY pfline
  1530. END
  1531. emnum=getinput(1 0 pen3'Select Email Number > 'def);
  1532. IF ~DATATYPE(emnum,'N') | emnum<1 | emnum>picklist.0 THEN RETURN(0);
  1533. RETURN(emnum);
  1534.  
  1535.  
  1536. sysED:
  1537. IF level<99 THEN RETURN;
  1538. arg=getinput(0 0 'Textfile To Edit: ');
  1539. IF arg='' THEN RETURN;
  1540. CALL bbsED(1 arg)
  1541. RETURN;
  1542.  
  1543.  
  1544. bbsED:
  1545. PARSE ARG firstedit editarg .
  1546. notchanged=1
  1547. IF readlines(editarg 1) THEN RETURN(1);
  1548. SAY 
  1549. SAY '                   'pen3'Entering the EDITOR module..'def
  1550. SAY 
  1551. count=1
  1552. DO edloop=1
  1553.   IF edcom='S' & bbsprefs.5 THEN  /* spell check */
  1554.     DO
  1555.       SAY pen3'You must use ['def'R'pen3']eplace to make corrections.  'pen2'Spellchecking...'def
  1556.       CALL DELETE(scratch'/SpellFile');
  1557.       CALL savelines(scratch'/SpellFile');
  1558.       curdir=PRAGMA('D')
  1559.       CALL setdir(spellpath);
  1560.       CALL SpellChk.rexx(scratch'/SpellFile');
  1561.       CALL setdir(curdir);
  1562.     END
  1563.   ELSE
  1564.     DO
  1565.       IF edcom='R' | edcom='I' | edcom='L' THEN CALL wrapbuf(7);
  1566.       IF count>=lynes.0 THEN count=1
  1567.       startcount=count
  1568.       DO i=startcount TO lynes.0+1
  1569.         IF ((i+1-startcount)//linesperpage)=0 THEN
  1570.           DO
  1571.             pline='                 ['pen3'E'def']dit'
  1572.             pline=pline '  ['pen3'RETURN'def']=Continue '
  1573.             edcom=getinput(1 1 pline);
  1574.             IF edcom~='' THEN LEAVE i
  1575.             CALL cleanline(1);
  1576.           END
  1577.         SAY pen3||RIGHT(i,2)||def lynes.i
  1578.         count=count+1
  1579.       END
  1580.     END
  1581.   pline=lineup' ['pen3'A'def']ppend ['pen3'C'def']ut ['pen3'I'def']nsert'
  1582.   pline=pline '['pen3'K'def']ill ['pen3'L'def']ist ['pen3'P'def']aste ['pen3'R'def']eplace'
  1583.   IF bbsprefs.5 THEN pline=pline '['pen3'S'def']pellcheck'
  1584.   pline=pline '> '
  1585.   edcom=getinput(1 1 pline);
  1586.   IF edcom='K' THEN
  1587.     DO
  1588.       junk=getinput(1 1 'Are you' pen3'sure'def 'you want to delete' editarg'? (yN) > ')
  1589.       IF junk='Y' THEN
  1590.         DO
  1591.           CALL DELETE(editarg)
  1592.           SAY editarg 'DELETED.'
  1593.           IF WORD(lynes.1,1)='Mail:' & WORDS(lynes.2)>3 THEN
  1594.             DO
  1595.               CALL DELETE(bbspath'EmailFiles/'WORD(lynes.3,2)'/'WORD(lynes.2,4))
  1596.               SAY WORD(lynes.2,4) 'DELETED.'
  1597.             END
  1598.           RETURN(2);
  1599.         END
  1600.     END
  1601.   IF edcom='' THEN
  1602.     DO
  1603.       SAY lineup'                   'pen3'Leaving the EDITOR module.                              'def
  1604.       IF notchanged THEN RETURN(0);
  1605.       IF getinput(1 1 '                     Save changes? (nY)'pen3' > 'def)='N' THEN
  1606.         RETURN(1);
  1607.       CALL DELETE(editarg)
  1608.       IF savelines(editarg) THEN RETURN(1);
  1609.       SAY pen3'                        Changes saved.'def
  1610.       RETURN(0);
  1611.     END
  1612.   ELSE IF edcom='C' THEN  /* Cut */
  1613.     DO
  1614.       firstnum=getinput(1 0 '   Enter line number or range 'pen3'(5-7)'def' to cut' pen3'>'def);
  1615.       IF firstnum='' THEN ITERATE edloop
  1616.       dash=POS('-',firstnum)
  1617.       IF dash>0 THEN
  1618.         DO
  1619.           lastnum=STRIP(SUBSTR(firstnum,dash+1))
  1620.           firstnum=STRIP(LEFT(firstnum,dash-1))
  1621.         END
  1622.       ELSE lastnum=firstnum
  1623.       IF ~DATATYPE(firstnum,'N') | ~DATATYPE(lastnum,'N') THEN
  1624.         DO
  1625.           junk=getinput(1 1 pen3'*** You must enter numbers here! 'def);
  1626.           ITERATE edloop
  1627.         END
  1628.       IF lastnum>lynes.0 THEN lastnum=lynes.0
  1629.       IF firstnum<firstedit THEN
  1630.         DO
  1631.           SAY '*** You are not authorized to delete that line!'
  1632.           ITERATE edloop
  1633.         END
  1634.       IF firstnum>lastnum THEN
  1635.         DO
  1636.           SAY '*** Input error!  First number larger than last number'
  1637.           ITERATE edloop
  1638.         END
  1639.       notchanged=0
  1640.       numdiff=lastnum+1-firstnum
  1641.       pasted.=''
  1642.       pasted.0=numdiff
  1643.       k=0
  1644.       DO i=firstnum TO lynes.0
  1645.         j=i+numdiff
  1646.         k=k+1
  1647.         IF k<=numdiff THEN pasted.k=lynes.i
  1648.         lynes.i=lynes.j
  1649.         lynes.j=''
  1650.       END
  1651.       lynes.0=lynes.0-numdiff
  1652.     END
  1653.   ELSE IF edcom='A' THEN  /* append */
  1654.     DO
  1655.       CALL writebuffer(scratch'/EditorFile');
  1656.       notchanged=0
  1657.     END
  1658.   ELSE IF edcom='F' THEN  /* fileappend */
  1659.     DO
  1660.       OPTIONS PROMPT 'Filename: '
  1661.       PARSE PULL farg
  1662.       IF EXISTS(farg) THEN
  1663.         DO
  1664.           CALL readlines(farg lynes.0+1);
  1665.           notchanged=0
  1666.         END
  1667.     END
  1668.   ELSE IF edcom='I' | edcom='R' | edcom='L' | edcom='P' THEN
  1669.     DO
  1670.       line=pen3'   '
  1671.       IF edcom='L' | edcom='P' THEN line=line'Starting '
  1672.       line=line'Line Number? > 'def
  1673.       ednum=getinput(1 0 line);
  1674.       IF ~DATATYPE(ednum,'N') THEN ITERATE edloop
  1675.       IF edcom='L' THEN
  1676.         DO
  1677.           count=ednum
  1678.           ITERATE edloop
  1679.         END
  1680.       IF ednum<firstedit THEN
  1681.         DO
  1682.           SAY '*** You are not authorized to alter that line!'
  1683.           ITERATE edloop
  1684.         END
  1685.       IF edcom='R' THEN   /* replace */
  1686.         DO
  1687.           SAY '   Now reads:'
  1688.           SAY pen3||RIGHT(ednum,2)||def lynes.ednum
  1689.           stext=getinput(0 0 pen3'........Search text? >'def);
  1690.           IF LENGTH(stext)=0 THEN
  1691.             DO
  1692.               IF getinput(1 1 lineup||pen3'Replace entire line? (nY) >'def)='N' THEN
  1693.                 ITERATE edloop
  1694.               lynes.ednum=getinput(0 0 pen3||RIGHT(ednum,2)' 'def);
  1695.               notchanged=0
  1696.               ITERATE edloop
  1697.             END
  1698.           found=POS(UPPER(stext),UPPER(lynes.ednum))
  1699.           IF found=0 THEN
  1700.             DO
  1701.               SAY stext' was not found!'
  1702.               ITERATE edloop
  1703.             END
  1704.           rtext=getinput(0 0 pen3'...Replacement text? >'def);
  1705.           lynes.ednum=DELSTR(lynes.ednum,found,LENGTH(stext))
  1706.           lynes.ednum=INSERT(rtext,lynes.ednum,found-1)
  1707.           SAY 'Done.'
  1708.           SAY 
  1709.           notchanged=0
  1710.         END
  1711.       ELSE IF edcom='I' THEN   /* insert */
  1712.         DO
  1713.           DO i=lynes.0 TO ednum BY -1
  1714.             j=i+1
  1715.             lynes.j=lynes.i
  1716.           END
  1717.           lynes.ednum=''
  1718.           notchanged=0
  1719.           lynes.0=lynes.0+1
  1720.           lynes.ednum=getinput(0 0 pen3||RIGHT(ednum,2)'>'def);
  1721.         END
  1722.       ELSE IF edcom='P' THEN   /* paste */
  1723.         DO
  1724.           DO i=lynes.0 TO ednum BY -1
  1725.             j=i+pasted.0
  1726.             lynes.j=lynes.i
  1727.           END
  1728.           DO k=1 TO pasted.0
  1729.             kk=ednum+k-1
  1730.             lynes.kk=pasted.k
  1731.           END
  1732.           notchanged=0
  1733.           lynes.0=lynes.0+pasted.0
  1734.         END
  1735.     END
  1736. END
  1737. RETURN(0);
  1738.  
  1739.  
  1740. editor:
  1741. toname=''
  1742. msgnum=0
  1743. thechosen.=''
  1744. PARSE ARG edtype toname msgnum .
  1745. IF edtype='MAIL' THEN lastwrit=countcheck(bbspath'Numbers/LastMail 0')
  1746. ELSE 
  1747.   DO
  1748.     IF edtype='MSG' THEN
  1749.       DO
  1750.         tempmsgdir=0
  1751.         IF DATATYPE(arg,'N') THEN tempmsgdir=arg
  1752.         IF tempmsgdir>0 & tempmsgdir<=level & msg.tempmsgdir~='' THEN
  1753.           msgdir=tempmsgdir
  1754.         ELSE IF areaselect() THEN RETURN;
  1755.       END
  1756.     lastwrit=countcheck(bbspath'Numbers/LastMessage'msgdir' 0')
  1757.   END
  1758. IF toname='' THEN
  1759.   DO
  1760.     IF edtype='MAIL' THEN
  1761.       DO
  1762.         CALL selectchosen(1 pen3'Send' edtype lastwrit+1 'To: 'def);
  1763.         toname=thechosen.1
  1764.       END
  1765.     ELSE toname=getinput(1 0 pen3'Post Message To: 'def);
  1766.   END
  1767. toname=SPACE(toname,1,'_')
  1768. toname=COMPRESS(toname,':/*#?^ ')
  1769. IF toname='' | FIND(exclusionlist,toname)>0 THEN
  1770.   DO
  1771.     IF toname='' & edtype='MSG' THEN toname='ALL'
  1772.     ELSE toname=sysop
  1773.     SAY '                    'lineup||toname'                      '
  1774.   END
  1775. IF toname~='ALL' THEN
  1776.   DO
  1777.     IF FIND(userlist,toname)=0 | toname='' THEN
  1778.       DO
  1779.         SAY 
  1780.         SAY bak2' 'toname' is not on the user list! 'def
  1781.         IF edtype='MAIL' THEN
  1782.           DO
  1783.             CALL showuserlist();
  1784.             RETURN(0);
  1785.           END
  1786.         ELSE
  1787.           DO
  1788.             IF getinput(1 1 'Do you want to use it anyway? (nY) > ')='N' THEN
  1789.               DO
  1790.                 IF getinput(1 1 'Do you want to see the list of current users? (yN) > ')='Y' THEN
  1791.                   DO
  1792.                     CALL showuserlist();
  1793.                     RETURN(0);
  1794.                   END
  1795.               END
  1796.           END
  1797.       END
  1798.   END
  1799. IF edtype='MAIL' THEN
  1800.   DO
  1801.     CALL MAKEDIR(bbspath'EMail/'toname)
  1802.     mailname=bbspath'EMail/'toname'/'name'.'lastwrit+1
  1803.   END
  1804. ELSE
  1805.   DO
  1806.     CALL MAKEDIR(msgpath||msgdir)
  1807.     mailname=msgpath||msgdir'/'lastwrit+1
  1808.   END
  1809. lynes.=''
  1810. IF edtype='MAIL' THEN lynes.1=' Mail:' lastwrit+1
  1811. ELSE lynes.1='  Msg:' lastwrit+1         /*   Msg: MSG# REPLY # # ... */
  1812. lynes.2=' From:' name                   /* From: name  FILE: filename */
  1813. IF edtype~='MAIL' THEN
  1814.   DO
  1815.     temp=TRANSLATE(data.3,'         ','+-.*/()<>')
  1816.     DO i=WORDS(temp) TO 1 BY -1
  1817.       IF DATATYPE(WORD(temp,i),'N') THEN temp=STRIP(DELWORD(temp,i,1))
  1818.       IF UPPER(WORD(temp,i))='USA' THEN temp=STRIP(DELWORD(temp,i,1))
  1819.     END
  1820.     lynes.2=lynes.2' - 'temp           /* if msg, add location (city) */
  1821.   END
  1822. lynes.3='   To:' toname                        /*  To: toname   MSG # */
  1823. subj=''
  1824. IF edtype='REPLY' THEN subj=SUBSTR(forthline,WORDINDEX(forthline,2))
  1825. ELSE IF edtype='MAIL' & replysubj~='' THEN subj=replysubj
  1826. ELSE
  1827.   DO
  1828.     IF opt='C' THEN subj='FEEDBACK'
  1829.     ELSE
  1830.       DO
  1831.         SAY pen3'Enter the'def 'Subject' pen3'of this message (1 line).'def
  1832.         subj=getinput(0 0 pen3': 'def);
  1833.       END
  1834.   END
  1835. lynes.4=' Subj:' subj
  1836. lynes.5=' Date:' DATE('W') DATE()'  'TIME('C')
  1837. IF edtype~='MAIL' THEN lynes.5=LEFT(lynes.5,39) 'Conference:' msg.msgdir
  1838. lynes.6=INSERT('','',1,75,'=')
  1839. IF edtype='REPLY' THEN lynes.3=lynes.3'  MSG 'msgnum
  1840. DO i=1 TO 6
  1841.   SAY lynes.i
  1842. END
  1843. CALL writebuffer(scratch'/MessageFile');
  1844. CALL readlines(scratch'/MessageFile' 1);
  1845. CALL seelines();
  1846. IF savelines(mailname) THEN RETURN(0);
  1847. IF thechosen.0='' THEN
  1848.   DO
  1849.     thechosen.0=1
  1850.     thechosen.1=toname
  1851.   END
  1852. carbons=thechosen.0+1
  1853. DO FOREVER
  1854.   pline=''
  1855.   IF edtype='MAIL' THEN pline='['pen3'C'def']opies'
  1856.   pline=pline '['pen3'E'def']dit ['pen3'K'def']ill ['pen3'R'def']ead'
  1857.   pline=pline '['pen3'U'def']pload-Text ['pen3'S'def']end' edtype'? (ekruS) 'def
  1858.   junk=getinput(1 1 pline);
  1859.   IF junk='E' THEN
  1860.     DO
  1861.       IF level>sysoplevel THEN firstedit=1
  1862.       ELSE firstedit=7
  1863.       IF bbsED(firstedit mailname)=2 THEN RETURN(0);
  1864.       junk='R'
  1865.     END
  1866.   ELSE IF edtype='MAIL' & junk='C' THEN
  1867.     DO
  1868.       CALL selectchosen(carbons pen3'Carbon Copies To: 'def);
  1869.       junk='R'
  1870.     END
  1871.   ELSE IF junk='K' THEN
  1872.     DO
  1873.       CALL DELETE(mailname)
  1874.       SAY edtype 'DELETED.'
  1875.       RETURN(0);
  1876.     END
  1877.   ELSE IF junk='U' THEN
  1878.     DO
  1879.       SAY 'Ready to append' pen3'TEXT ONLY'def
  1880.       pline='Are you SURE your file is un-compressed text? (yN) > '
  1881.       IF getinput(1 1 pline)='Y' THEN
  1882.         DO
  1883.           arg='UploadFile'
  1884.           curdir=PRAGMA('D')
  1885.           CALL setdir(scratch)
  1886.           CALL DELETE(arg)
  1887.           CALL DELETE('tempfile1')
  1888.           IF uload(0)=0 THEN
  1889.             DO
  1890.               CALL RENAME(mailname,'tempfile1')
  1891.               ADDRESS COMMAND 'join tempfile1 UploadFile AS' mailname
  1892.             END
  1893.           CALL setdir(curdir)
  1894.         END
  1895.       junk='R'
  1896.     END
  1897.   IF junk='R' THEN
  1898.     DO
  1899.       CALL readlines(mailname 1);
  1900.       CALL seelines();
  1901.       nonstop=0
  1902.     END
  1903.   ELSE BREAK;
  1904. END
  1905. IF edtype='MAIL' THEN
  1906.   DO
  1907.     IF replysubj~='' & readname~='' & uname~='' THEN
  1908.       DO
  1909.         junk=getinput(1 1 'Attach original mail from' uname'? (yN) > ');
  1910.         IF junk='Y' THEN
  1911.           DO
  1912.             arg=bbspath'Email/'name'/'readname
  1913.             IF ~readlines(arg 1) THEN CALL savelines(mailname);
  1914.           END
  1915.       END
  1916.     junk=getinput(1 1 pen3'Attach a file to this message? (yN) > 'def);
  1917.     IF junk='Y' THEN
  1918.       DO
  1919.         arg=getinput(0 0 'Filename: ')
  1920.         curdir=PRAGMA('D')
  1921.         CALL MAKEDIR(bbspath'EmailFiles/'toname)
  1922.         CALL setdir(bbspath'EmailFiles/'toname)
  1923.         IF uload(0)=0 & WORD(STATEF(bbspath'EmailFiles/'toname'/'arg),1)>1 THEN
  1924.           DO
  1925.             IF arg~='' THEN lynes.2=lynes.2'  FILE: 'arg
  1926.             CALL setdir(curdir)
  1927.             CALL DELETE(mailname)
  1928.             CALL savelines(mailname)
  1929.           END
  1930.         ELSE
  1931.           DO
  1932.             CALL DELETE(bbspath'EmailFiles/'toname'/'arg)
  1933.             SAY pen3'*** Upload failed! ***'def
  1934.           END
  1935.       END
  1936.   END
  1937. IF edtype='MAIL' THEN
  1938.   DO
  1939.     totmail=WORD(data.17,2)
  1940.     IF ~DATATYPE(totmail,'N') THEN totmail=1
  1941.     ELSE totmail=totmail+1
  1942.     data.17=WORD(data.17,1)'  'totmail'  'WORD(data.17,3)
  1943.   END
  1944. ELSE totwrit.msgdir=totwrit.msgdir+1
  1945. CALL readlines(mailname 1)
  1946. DO ui=1 TO thechosen.0
  1947.   IF thechosen.ui='' THEN ITERATE ui
  1948.   IF ui>1 THEN
  1949.     DO
  1950.       CALL MAKEDIR(bbspath'Email/'thechosen.ui)
  1951.       newname=bbspath'Email/'thechosen.ui'/'name'.'lastwrit+1
  1952.       IF ui<carbons THEN lynes.3='   To:' thechosen.ui
  1953.       ELSE
  1954.         DO
  1955.           lynes.1=lynes.1'  (Carbon Copy)'
  1956.           lynes.3='   To:' thechosen.1
  1957.         END
  1958.       CALL savelines(newname)
  1959.       IF WORDS(lynes.2)>3 & EXISTS(bbspath'EmailFiles/'thechosen.1'/'WORD(lynes.2,4)) THEN
  1960.         DO
  1961.           CALL MAKEDIR(bbspath'EmailFiles/'thechosen.ui)
  1962.           ADDRESS COMMAND 'COPY' bbspath'EmailFiles/'thechosen.1'/'WORD(lynes.2,4) bbspath'EmailFiles/'thechosen.ui
  1963.           line2='Copied' WORD(lynes.2,4)
  1964.           SAY line2 'to the' thechosen.ui 'file area.'
  1965.         END
  1966.     END
  1967.   line=edtype':'lastwrit+1 'at' TIME('C') 'to' thechosen.ui
  1968.   IF edtype~='MAIL' THEN
  1969.     DO
  1970.       IF FIND(userlist,thechosen.ui)>0 THEN
  1971.         CALL msgmark(thechosen.ui msgdir lastwrit+1);
  1972.       line=line 'in' msg.msgdir
  1973.     END
  1974.   line=edtype 'Sent To' thechosen.ui
  1975.   IF edtype~='MAIL' THEN line=line 'in the' msg.msgdir 'conference.'
  1976.   SAY line
  1977. END
  1978. IF edtype='MAIL' THEN CALL countcheck(bbspath'Numbers/LastMail 'lastwrit+1)
  1979. ELSE
  1980.   DO
  1981.     IF DATATYPE(msg.msgdir.0,'N') THEN msg.msgdir.0=msg.msgdir.0+1
  1982.     ELSE msg.msgdir.0=1
  1983.     CALL countcheck(bbspath'Numbers/LastMessage'msgdir lastwrit+1)
  1984.   END
  1985. CALL setdir(libpath||dirs.1);
  1986. thechosen.=''
  1987. RETURN(1);
  1988.  
  1989.  
  1990. msgmark:
  1991. PARSE ARG markname markdir markmsg .
  1992. IF OPEN(f,bbspath'Users/'markname)=0 THEN RETURN;
  1993. mlines.=''
  1994. DO mi=1 TO 24
  1995.   mlines.mi=READLN(f)
  1996. END
  1997. mlines.24=STRIP(mlines.24 markdir'/'markmsg)
  1998. CALL SEEK(f,0,'B')
  1999. DO mi=1 TO 24
  2000.   CALL WRITELN(f,mlines.mi)
  2001. END
  2002. CALL CLOSE(f)
  2003. RETURN;
  2004.  
  2005.  
  2006. shell:
  2007. SAY
  2008. DO WHILE(UPPER(opt)~='EXIT')
  2009.   SAY bak2||TIME('C')||def PRAGMA('D')
  2010.   OPTIONS PROMPT pen3'Type EXIT to quit AmigaDOS> 'def
  2011.   PARSE PULL opt' 'arg .
  2012.   IF(UPPER(opt)='CD') THEN CALL setdir(arg)
  2013.   ELSE IF exists(opt)~=0 THEN
  2014.     DO
  2015.       IF left(statef(opt),3)='DIR' THEN CALL setdir(opt)
  2016.     END
  2017.   ELSE IF(opt~='' & UPPER(opt)~='EXIT') THEN
  2018.     ADDRESS COMMAND opt '<* >*' arg
  2019. END
  2020. RETURN;
  2021.  
  2022.  
  2023. edfilenote:
  2024. arg=getinput(0 0 pen3'Select File: 'def);
  2025. IF EXISTS(arg) THEN
  2026.   DO
  2027.     ADDRESS COMMAND 'List' arg
  2028.     CALL editcomment();
  2029.   END
  2030. RETURN;
  2031.  
  2032.  
  2033. editcomment:
  2034. SAY 'Please enter a one-line description of' arg'.'
  2035. comment=getinput(0 0 pen3': 'def);
  2036. IF LENGTH(comment)>77 THEN comment=STRIP(LEFT(comment,77))
  2037. IF LENGTH(comment)>0 THEN
  2038.   DO
  2039.     comment=SPACE(comment,1,'_')
  2040.     ADDRESS COMMAND 'filenote' directory'/'arg comment
  2041.   END
  2042. RETURN;
  2043.  
  2044.  
  2045. bbsspace:
  2046. ADDRESS COMMAND 'info >ram:infout' bbsdevice
  2047. ok=OPEN(f,'ram:infout','R')
  2048. IF ok=0 THEN RETURN(20)
  2049. line=READLN(f)
  2050. line=READLN(f)
  2051. line=READLN(f)
  2052. line=READLN(f)
  2053. CALL CLOSE(f)
  2054. SAY 
  2055. bbsk=WORD(line,4)
  2056. IF ~DATATYPE(bbsk,'N') THEN
  2057.   DO
  2058.     line=bbsdevice 'is not an info compatible device!'
  2059.     SAY pen3||line||def
  2060.     bbsk=0
  2061.     RETURN;
  2062.   END
  2063. bbsk=TRUNC(bbsk/2+.5)
  2064. SAY '  'bbsk'k available for uploads.'
  2065. RETURN;
  2066.  
  2067.  
  2068. uload:
  2069. ARG frommenu
  2070. CALL bbsspace();
  2071. IF (bbsk*1000)<SYSTEM_SPACE_LIMIT THEN
  2072.   DO
  2073.     SAY pen3'Upload area is full!'def
  2074.     RETURN(1);
  2075.   END
  2076. IF arg='' THEN arg=getinput(0 0 'Filename: ');   /* no filename given */
  2077. IF arg='' THEN RETURN(1);          /* check for filename */
  2078. arg=TRANSLATE(arg,'     ',':/,;|')   /* be sure no illegals here */
  2079. IF WORDS(arg)>1 THEN arg=STRIP(WORD(arg,1))
  2080. IF frommenu THEN
  2081.   DO
  2082.     SAY 'Please select an appropriate library for' pen3||arg||def'.'
  2083.     CALL chdir();
  2084.   END
  2085. filenum=countcheck(bbspath'Numbers/LastFile' 0)
  2086. DO ui=1 TO filenum-1 WHILE frommenu
  2087.   IF WORD(files.ui,2)=arg THEN
  2088.     DO
  2089.       temp=WORD(files.ui,1)
  2090.       line=pen3'*** File' arg 'already exists here in the'
  2091.       line=line temp 'directory.'def
  2092.       SAY line
  2093.       SAY 'Original uploader may ['pen3'K'def']ill the file before uploading the replacement.'
  2094.       IF level>sysoplevel & UPPER(SUBSTR(PRAGMA('D'),LENGTH(libpath)+1))~=UPPER(temp) THEN LEAVE ui
  2095.       ELSE RETURN(1);
  2096.     END
  2097. END
  2098. temp=SUBSTR(PRAGMA('D'),LENGTH(libpath)+1)
  2099. SAY ' Select File to Copy To' temp'/'arg
  2100. fromfile=GetFile(150,36,libpath'SysOps',arg,' Select File to Copy ')
  2101. IF fromfile='' THEN RETURN(1);
  2102. ADDRESS COMMAND 'Copy' fromfile PRAGMA('D')'/'arg
  2103. IF LEFT(UPPER(temp),10)='EMAILFILES' THEN RETURN(0);
  2104. DO ui=sysoplevel+2 TO 100
  2105.   IF UPPER(dirs.ui)=UPPER(temp) THEN RETURN(0);
  2106. END
  2107. IF frommenu THEN
  2108.   DO WHILE editnote(PRAGMA('D')'/'arg)  /* INSIST on a filenote */
  2109.   END
  2110. RETURN(0);
  2111.  
  2112.  
  2113. findfiles:
  2114. PARSE ARG ffile
  2115. IF ~EXISTS(ffile) THEN
  2116.   DO
  2117.     nextfilenum=countcheck(bbspath'Numbers/LastFile' 0)+1
  2118.     DO ui=1 TO nextfilenum
  2119.       argtemp=WORD(files.ui,2)
  2120.       IF UPPER(argtemp)=UPPER(ffile) THEN
  2121.         DO
  2122.           dirtemp=WORD(files.ui,1)
  2123.           dirtemp=libpath||dirtemp
  2124.           CALL setdir(dirtemp)
  2125.           RETURN(0);
  2126.         END
  2127.       IF ui=nextfilenum THEN
  2128.         DO
  2129.           SAY '***' ffile 'does not exist!'
  2130.           RETURN(1);
  2131.         END
  2132.     END
  2133.   END
  2134. RETURN(0);
  2135.  
  2136.  
  2137. dload:
  2138. errorflag=0
  2139. curdir=PRAGMA('D')
  2140. OPTIONS PROMPT 'Filenames and/or numbers: '
  2141. IF arg='' THEN PARSE PULL arg  /* no filename given */
  2142. IF DATATYPE(arg,'N') THEN arg=WORD(files.arg,2)
  2143. IF arg='' THEN RETURN;
  2144. IF findfiles(arg) THEN RETURN;
  2145. arg=TRANSLATE(arg,'  ',':/')
  2146. IF WORDS(arg)>1 THEN arg=WORD(arg,1)
  2147. IF(arg~='') THEN           /* check for filename */
  2148.   DO dloadloop=1
  2149.     SAY ' Select Filename to Copy ' PRAGMA('D')'/'arg 'To:'
  2150.     tofile=GetFile(150,36,libpath'Sysops',arg,' Select Destination File ')
  2151.     IF tofile='' THEN
  2152.       DO
  2153.         errorflag=1
  2154.         LEAVE dloadloop
  2155.       END
  2156.     ADDRESS COMMAND 'Copy' PRAGMA('D')'/'arg tofile
  2157.     filedir=SUBSTR(PRAGMA('D'),LENGTH(libpath)+1)
  2158.     IF POS('EMAILFILES',UPPER(PRAGMA('D')))>0 THEN LEAVE dloadloop
  2159.     DO di=sysoplevel+2 TO 100
  2160.       IF UPPER(dirs.di)=UPPER(filedir) THEN LEAVE dloadloop
  2161.     END
  2162.     notename=bbspath'FileNotes/'filedir'/'arg    /* increment download count */
  2163.     IF readlines(notename 1) THEN LEAVE dloadloop
  2164.     dls=WORD(lynes.2,7)
  2165.     IF ~DATATYPE(dls,'N') THEN dls=0
  2166.     lynes.2=STRIP(DELWORD(lynes.2,7,1)) dls+1
  2167.     CALL DELETE(notename)
  2168.     CALL savelines(notename)
  2169.     LEAVE dloadloop
  2170.   END
  2171. CALL setdir(curdir);
  2172. IF errorflag THEN SAY pen3'*** Download Failed!'def
  2173. RETURN;
  2174.  
  2175.  
  2176. editnote:
  2177. IF arg='' THEN
  2178.   DO
  2179.     PARSE PULL arg .
  2180.     IF arg='' | findfiles(arg)>0 THEN RETURN;
  2181.   END
  2182. slash=LASTPOS('/',arg)
  2183. IF slash=0 THEN slash=LASTPOS(':',arg)
  2184. IF slash>0 THEN
  2185.   DO
  2186.     filedir=LEFT(arg,slash-1)
  2187.     filedir=SUBSTR(filedir,5)
  2188.     arg=SUBSTR(arg,slash+1)
  2189.   END
  2190. ELSE filedir=plaindir
  2191. CALL MAKEDIR(bbspath'FileNotes/'filedir)
  2192. IF ~EXISTS(bbspath'FileNotes/'filedir) THEN
  2193.   DO
  2194.     SAY pen3'*** Failed to open directory!' filedir||def
  2195.     RETURN(0);
  2196.   END
  2197. notename=bbspath'FileNotes/'filedir'/'arg
  2198. lynes.=''
  2199. filenum=countcheck(bbspath'Numbers/LastFile' 0)
  2200. IF level>sysoplevel THEN firstedit=1
  2201. ELSE firstedit=5
  2202. IF EXISTS(notename) THEN
  2203.   DO
  2204.     CALL bbsED(firstedit notename);
  2205.     RETURN(0);
  2206.   END
  2207. ELSE
  2208.   DO
  2209.     filedata=STATEF(libpath||filedir'/'arg)
  2210.     IF filedata='' THEN
  2211.       DO
  2212.         SAY filedir'/'arg 'does not exist!'
  2213.         RETURN(0);
  2214.       END
  2215.     bytes=WORD(filedata,2)
  2216.     filenum=filenum+1
  2217.     lynes.0=4
  2218.     lynes.1='File: 'LEFT(filenum,6)'KeyWords:'
  2219.     lynes.2='Name: 'LEFT(arg,28)'Size: 'bytes' bytes   Downloads: 0'
  2220.     lynes.3='  By: 'LEFT(name,28)'Date: 'DATE() TIME('C')'  Lib: 'filedir
  2221.     lynes.4=INSERT('','',1,75,'=')
  2222.     SAY 'Please enter a list of keywords to be used by the search routine.'
  2223.     SAY INSERT('','',1,75,'=')
  2224.     templine=getinput(0 0 pen3'              KeyWords: 'def);
  2225.     lynes.1=lynes.1 templine
  2226.   END
  2227. CALL seelines();
  2228. CALL writebuffer(scratch'/NoteFile');
  2229. CALL readlines(scratch'/NoteFile' 1);
  2230. IF savelines(notename) THEN RETURN(0);
  2231. fncom='R'
  2232. DO WHILE fncom='R'
  2233.   line='['pen3'C'def']ancel ['pen3'E'def']dit'
  2234.   IF level>sysoplevel THEN line=line '['pen3'K'def']ill'
  2235.   line=line '['pen3'R'def']ead ['pen3'S'def']ave'
  2236.   IF level>sysoplevel THEN line=line '(cekrS) 'def
  2237.   ELSE line=line '(cerS) 'def
  2238.   fncom=getinput(1 1 line);
  2239.   IF fncom='C' THEN RETURN(1);
  2240.   ELSE IF fncom='K' THEN
  2241.     DO
  2242.       IF level>sysoplevel THEN
  2243.         DO
  2244.           SAY 'Killing FileNote..'
  2245.           CALL DELETE(notename)
  2246.           RETURN(1);
  2247.         END
  2248.     END
  2249.   ELSE IF fncom='E' THEN
  2250.     DO
  2251.       IF bbsED(firstedit notename)>0 THEN RETURN(0);
  2252.       fncom='R'
  2253.     END
  2254.   ELSE IF fncom~='R' THEN
  2255.     DO
  2256.       SAY 'Saving FileNote..'
  2257.       IF filenum<1 THEN filenum=1
  2258.       CALL countcheck(bbspath'Numbers/LastFile' filenum)
  2259.       files.0=files.0+1
  2260.       files.filenum=plaindir arg
  2261.       CALL savefilelist();
  2262.       CALL seelines();
  2263.       CALL waiting();
  2264.       RETURN(0);
  2265.     END
  2266.   CALL seelines();
  2267.   nonstop=0
  2268. END
  2269. RETURN(0);
  2270.  
  2271.  
  2272. savefilelist:
  2273. xarg=bbspath'Lists/Files'
  2274. IF WORD(STATEF(xarg),1)>5 THEN
  2275.   DO
  2276.     CALL DELETE(xarg'.BAK')
  2277.     CALL RENAME(xarg,xarg'.BAK')
  2278.   END
  2279. filenum=countcheck(bbspath'Numbers/LastFile' 0)
  2280. IF filenum<1 | writeopen(xarg)=0 THEN RETURN(0);
  2281.   DO i=1 TO filenum
  2282.     IF files.i='' THEN ITERATE
  2283.     CALL WRITELN(f,i files.i)
  2284.   END
  2285. CALL CLOSE(f)
  2286. RETURN;
  2287.  
  2288.  
  2289. viewuser:
  2290. SAY 
  2291. SAY bak2' 'name' 'def
  2292. DO i=1 TO 18
  2293.   stuff=data.i
  2294.   IF i=13 | i=14 THEN stuff=DATE(,data.i,'S')
  2295.   SAY RIGHT(i,2)||pen3 text.i||def':' stuff
  2296. END
  2297. CALL waiting();
  2298. RETURN;
  2299.  
  2300.  
  2301. edituser:
  2302. new=0
  2303. change=0
  2304. edata.=''
  2305. edname=name
  2306. DO i=0 TO data.0
  2307.   edata.i=data.i
  2308. END
  2309. num=1
  2310. DO WHILE num~='' | edname~=name
  2311.   IF num='' THEN
  2312.     DO
  2313.       IF change THEN
  2314.         DO
  2315.           CALL SetData();
  2316.           CALL saveData(1);
  2317.           change=0
  2318.         END
  2319.       IF new THEN
  2320.         DO
  2321.           data.=''
  2322.           DO i=0 TO edata.0
  2323.             data.i=edata.i
  2324.           END
  2325.           name=edname
  2326.           new=0
  2327.         END
  2328.       CALL SetData();
  2329.     END
  2330.   maxnum=10
  2331.   IF edata.20>sysoplevel THEN maxnum=20
  2332.   IF edata.20=99 THEN maxnum=23
  2333.   SAY bak2' 'name' 'def
  2334.   maxlines=21
  2335.   IF maxnum=10 THEN maxlines=20
  2336.   DO i=1 TO maxlines
  2337.     IF i=5 & name~=edname & edata.20<99 THEN ITERATE;
  2338.     SAY RIGHT(i,2)||pen3 text.i||def':' data.i
  2339.   END
  2340.   IF edata.20>sysoplevel THEN
  2341.     DO
  2342.       line=LEFT(' ',50)
  2343.       IF name=edname THEN line=line'NEW = Change User.'
  2344.       line=pen3||line||def||lineup
  2345.       SAY line
  2346.     END
  2347.   num=getinput(1 0 'Select Line Number To Edit: ');
  2348.   IF num='NEW' & edata.20>sysoplevel & edname=name THEN    /* select a new user */
  2349.     DO
  2350.       new=1
  2351.       IF change THEN
  2352.         DO
  2353.           CALL SetData();
  2354.           CALL saveData(1)
  2355.         END
  2356.       change=0
  2357.       nufile=bbspath'Email/'sysop'/NEW_USERS'
  2358.       IF EXISTS(nufile) THEN
  2359.         IF ~readlines(nufile 1) THEN CALL seelines();
  2360.       savename=name
  2361.       name=getinput(1 0 'New User Name: 'def);
  2362.       name=SPACE(name,1,'_')
  2363.       name=COMPRESS(name,':/*#?^')
  2364.       IF loadData()=0 THEN name=savename
  2365.       IF data.20>=edata.20 THEN
  2366.         DO
  2367.           SAY 'Can''t Edit!' pen3||name def'has an equal or higher level than thee.'
  2368.           name=savename
  2369.           CALL loadData()
  2370.         END
  2371.     END
  2372.   ELSE IF DATATYPE(num,'N') & num>0 THEN
  2373.     DO
  2374.       IF num>maxnum THEN
  2375.         DO
  2376.           SAY 
  2377.           SAY pen3'You are not authorized to change that information!'def
  2378.           SAY 
  2379.         END
  2380.       ELSE
  2381.         DO dummy=1 TO 1
  2382.           line=RIGHT(num,2)||pen3 text.num||def': '
  2383.           SAY line||data.num
  2384.           temp=getinput(0 0 line);
  2385.           IF temp='' THEN
  2386.             DO
  2387.               IF num=1 | num=4 | num=5 | num=6 | num=7 THEN LEAVE dummy;
  2388.               IF num=11 | num=12 | num=13 | num=20 THEN LEAVE dummy;
  2389.             END
  2390.           IF num=5 | num=8 THEN temp=UPPER(temp)
  2391.           IF num=20 & DATATYPE(temp,'N') & temp>=edata.20 THEN
  2392.             temp=data.20
  2393.           IF edata.20>sysoplevel & name~=edname THEN line2=name' '
  2394.           ELSE line2=''
  2395.           IF num=21 & name=edname & edata.20<99 THEN LEAVE dummy
  2396.           line=text.num':' data.num pen6'CHANGED TO'def temp
  2397.           data.num=temp
  2398.           SAY line
  2399.           SAY 
  2400.           change=1
  2401.         END
  2402.     END
  2403. END
  2404. IF change THEN
  2405.   DO
  2406.     CALL SetData();
  2407.     CALL saveData(1);
  2408.   END
  2409. RETURN;
  2410.  
  2411.  
  2412. getname:
  2413. CALL showuserlist();
  2414. name=getinput(1 0 'Please enter your Email name : ');
  2415. IF name='' THEN
  2416.   DO
  2417.     SAY 'No name, no entry.  Bye!'
  2418.     SIGNAL DONE
  2419.   END
  2420. name=SPACE(name,1,'_')
  2421. name=COMPRESS(name,':/*#?^')
  2422. IF FIND(userlist,name)>0 | FIND(exclusionlist,name)>0 THEN
  2423.   DO
  2424.     SAY 'Sorry! That name is taken. Please try again.'
  2425.     RETURN(1);
  2426.   END
  2427. RETURN(0);
  2428.  
  2429.  
  2430. /** see if name is in data */
  2431.  
  2432. checkUser:
  2433. tries=0
  2434. IF name='NEW' THEN
  2435.   DO
  2436.     name=''
  2437.     DO WHILE getname()
  2438.     END
  2439.   END
  2440. IF FIND(userlist,name)=0 THEN
  2441.   DO
  2442.     IF EXISTS(bbspath'BBS_TEXT/NEW') THEN
  2443.       DO
  2444.         CALL readlines(bbspath'BBS_TEXT/NEW' 1);
  2445.         CALL seelines();
  2446.         CALL waiting();
  2447.       END
  2448.     SAY
  2449.     defile=bbspath'BBS_TEXT/DEF.NEW_USER'
  2450.     wordnum=FIND(courtesy,name)
  2451.     IF wordnum>0 THEN
  2452.       DO
  2453.         SAY name', is on the Courtesy List. You will be granted immediate access.'
  2454.         courtesy=STRIP(DELWORD(courtesy,wordnum,1))
  2455.         IF writeopen(bbspath'Lists/Courtesy') THEN
  2456.           DO
  2457.             DO i=1 TO WORDS(courtesy)
  2458.               CALL WRITELN(f,WORD(courtesy,i))
  2459.             END
  2460.             CALL CLOSE(f)
  2461.           END
  2462.         defile=bbspath'BBS_TEXT/DEF.COURTESY'
  2463.       END
  2464.     ELSE SAY name', You have new user access.'
  2465.     IF readlines(defile 1) THEN SIGNAL DONE
  2466.     data.=''
  2467.     data.0=24
  2468.     DO i=6 TO 21
  2469.       data.i=lynes.i
  2470.     END
  2471.     data.12=DATE('S')'  'TIME('C')
  2472.     data.13=data.12
  2473.     lastondate=DATE('I')-1
  2474.     SAY 'Please enter the password you would like to use here.'
  2475.     data.5=getinput(1 0 'Password: 'pen0);
  2476.     IF data.5='' THEN
  2477.       DO
  2478.         line=def||name 'refused to enter a password.'
  2479.         SIGNAL DONE
  2480.       END
  2481.     data.1=''
  2482.     DO WHILE data.1=''
  2483.       data.1=getinput(0 0 def'Full Name: ');
  2484.       IF data.1='' THEN SAY 'You MUST leave your real name!'
  2485.     END
  2486.     data.2=getinput(0 0 'Street: ');
  2487.     data.3=getinput(0 0 'City, State Zip: ');
  2488.     data.4=''
  2489.     DO WHILE data.4=''
  2490.       data.4=getinput(0 0 'Phone: ');
  2491.       IF data.4='' THEN
  2492.         SAY sysop 'MUST be able to reach you by phone to validate you!'
  2493.     END
  2494.     age=getinput(0 0 'Age: ');
  2495.     data.12=data.12'  Age:' age
  2496.     IF bbsprefs.8 THEN
  2497.       DO
  2498.         newufile=bbspath'EMail/'sysop'/NEW_USERS'
  2499.         IF EXISTS(newufile) THEN ok=OPEN(f,newufile,'A')
  2500.         ELSE ok=OPEN(f,newufile,'W')
  2501.         IF ok~=0 THEN CALL WRITELN(f,DATE() TIME() name'='data.1'   'data.4)
  2502.         CALL CLOSE(f)
  2503.       END
  2504.     data.9=getinput(0 0 'Computer: ');
  2505.     data.10=getinput(0 0 'Interests: ');
  2506.     test=getinput(1 1 pen3'Do you want other users to see your STREET address? (yN) > 'def);
  2507.     IF test='Y' THEN data.8=data.8 'STREET'
  2508.     test=getinput(1 1 pen3'Do you want other users to see your PHONE number? (yN) > 'def);
  2509.     IF test='Y' THEN data.8=data.8 'PHONE'
  2510.     SAY
  2511.     IF data.20=0 THEN
  2512.       SAY 'Thank you, the sysop will give you higher access soon.'
  2513.     SAY 'Please feel free to leave additional info by using [C]omment.'
  2514.     SAY
  2515.     CALL SetData();
  2516.     CALL saveData(1);
  2517.     SAY 'Adding' name 'to the user list.'
  2518.     newpassword=data.5
  2519.     CALL sortuserlist();
  2520.   END
  2521. ELSE
  2522.   DO
  2523.     IF loadData()=0 THEN SIGNAL DONE
  2524.     PARSE VAR data.11 amins . atimes .
  2525.     lastondate=DATE('I',WORD(data.13,1),'S')
  2526.     IF DATE('I')>lastondate THEN atimes=3
  2527.     IF level>sysoplevel THEN atimes=3
  2528.     IF level=99 THEN amins=120
  2529.     data.13=DATE('S')'  'TIME()
  2530.     data.11=amins 'minutes' atimes-1 'more times today'
  2531.     passprompt='Enter Password: '
  2532.     DO tries=1 TO 3
  2533.       OPTIONS PROMPT passprompt
  2534.       PULL newpassword
  2535.       IF(password=newpassword) THEN LEAVE tries; /* correct password */
  2536.       IF(tries=3) THEN
  2537.         DO                            /* 3 tries, hang up */
  2538.           SAY 
  2539.           SAY 'Access terminated.'
  2540.           line='*** Bad password ***'
  2541.           SIGNAL OUT
  2542.         END
  2543.       SAY lineup'                                 '
  2544.       passprompt='Incorrect.  Password: ' /* ask again */
  2545.     END
  2546.   END
  2547. CALL DELAY(14)
  2548. SAY 
  2549. RETURN;
  2550.  
  2551.  
  2552. saveData:
  2553. ARG messflag .
  2554. IF data.5='' THEN RETURN;
  2555. SAY 'Updating...'lineup
  2556. IF newfilesdate~='' THEN data.16=lastbrowse newfilesdate
  2557. ELSE IF lastbrowse>0 THEN
  2558.   DO
  2559.     IF WORDS(data.16)>1 THEN data.16=DELWORD(data.16,1,1)
  2560.     ELSE data.16=DATE('S') TIME()
  2561.     data.16=lastbrowse data.16
  2562.   END
  2563. IF messflag THEN
  2564.   DO
  2565.     userexclude.=0
  2566.     DO si=1 TO WORDS(data.22)
  2567.       IF WORD(data.22,si)=-1 THEN userexclude.si=1
  2568.     END
  2569.     data.22=''
  2570.     data.23=''
  2571.     DO si=1 TO level
  2572.       IF ~DATATYPE(lastread.si,'N') THEN lastread.si=0
  2573.       IF userexclude.si THEN data.22=data.22 '-1'
  2574.       ELSE data.22=data.22 lastread.si
  2575.       IF ~DATATYPE(totwrit.si,'N') THEN totwrit.si=0
  2576.       data.23=data.23 totwrit.si
  2577.     END
  2578.   END
  2579. IF writeopen(bbspath'USERS/'name)=0 THEN RETURN;
  2580. IF data.0<24 THEN data.0=24
  2581. DO i=1 TO data.0
  2582.   CALL WRITELN(f,data.i)
  2583. END
  2584. CALL CLOSE(f)
  2585. SAY 'User file' name 'has been updated.'
  2586. RETURN;
  2587.  
  2588.  
  2589. loadData:
  2590. IF name='' THEN RETURN(0);
  2591. IF ~readopen(bbspath'USERS/'name) THEN RETURN(0);
  2592. data.=''
  2593. DO i=1
  2594.   line=READLN(f)
  2595.   IF EOF(f) THEN BREAK;
  2596.   data.i=line
  2597. END
  2598. data.0=i-1
  2599. CALL CLOSE(f)
  2600. winnings=WORD(data.18,1)
  2601. IF ~DATATYPE(winnings,'N') THEN winnings=0
  2602.  
  2603. setData:
  2604. IF WORDS(data.16)<3 THEN data.16='0 19900101 00:00:00'
  2605. lastbrowse=WORD(data.16,1)
  2606. level=data.20
  2607. DO i=1 TO level
  2608.   lastread.i=WORD(data.22,i)
  2609.   IF ~DATATYPE(lastread.i,'N') THEN lastread.i=0
  2610.   totwrit.i=WORD(data.23,i)
  2611.   IF ~DATATYPE(totwrit.i,'N') THEN totwrit.i=0
  2612. END
  2613. password=data.5
  2614. linesperpage=data.7
  2615. IF FIND(UPPER(data.8),'COLOR')>0 THEN colorflag=1
  2616. ELSE colorflag=0
  2617. CALL colors(colorflag)
  2618. IF FIND(UPPER(data.8),'MENUS')>0 THEN menuflag=1
  2619. ELSE menuflag=0
  2620. IF FIND(UPPER(data.8),'MENU')>0 THEN
  2621.   DO
  2622.     menu='ALL'
  2623.     menuflag=1
  2624.   END
  2625. data.21=UPPER(data.21)
  2626. maxtime=WORD(data.11,1)*60
  2627. RETURN(1);
  2628.  
  2629.  
  2630. switchmenuflag:
  2631. IF menuflag=1 THEN
  2632.   DO
  2633.     menuflag=0
  2634.     noff='OFF'
  2635.   END
  2636. ELSE
  2637.   DO
  2638.     menuflag=1
  2639.     noff='ON'
  2640.   END
  2641. SAY 'Menus turned' pen3||noff||def'.'
  2642. SAY 'To make a permanent change, add or delete MENU(S) from [Y]our userdata item 8.'
  2643. RETURN;
  2644.  
  2645.  
  2646. switchcolors:
  2647. IF colorflag=1 THEN
  2648.   DO
  2649.     colorflag=0
  2650.     noff='OFF'
  2651.   END
  2652. ELSE
  2653.   DO
  2654.     colorflag=1
  2655.     noff='ON'
  2656.   END
  2657. CALL colors(colorflag);
  2658. SAY 'Color turned' pen3||noff||def'.'
  2659. SAY 'To make a permanent change, add or delete COLOR from [Y]our userdata item 8.'
  2660. RETURN;
  2661.  
  2662.  
  2663. /* ANSI pen color codes */
  2664. colors:
  2665. ARG onoff
  2666. def=''  /* default */
  2667. IF onoff THEN
  2668.   DO
  2669.     pen0='';  pen1='';  pen2='';  pen3='';
  2670.     pen4='';  pen5='';  pen6='';  pen7='';
  2671.     bak0='';  bak1='';  bak2='';  bak3='';
  2672.     bak4='';  bak5='';  bak6='';  bak7='';
  2673.   END
  2674. ELSE
  2675.   DO
  2676.     pen0=''; pen1=''; pen2=''; pen3=''; pen4=''; pen5=''; pen6=''; pen7='';
  2677.     bak0=''; bak1=''; bak2=''; bak3=''; bak4=''; bak5=''; bak6=''; bak7=''
  2678.   END
  2679. RETURN;
  2680.  
  2681.  
  2682. viewtext:
  2683. IF arg='' THEN PARSE PULL arg   /* no filename given */
  2684. IF arg='' THEN RETURN;
  2685. IF level<99 THEN
  2686.   arg=COMPRESS(arg,' :/*#?') /* no wildcards, no devs, no dirs allowed */
  2687. IF findfiles(arg) THEN RETURN;
  2688. CALL showtext(arg);
  2689. nonstop=0
  2690. RETURN;
  2691.  
  2692.  
  2693. information:
  2694. infolist=SHOWDIR(bbspath'Information')
  2695. IF infolist='' THEN
  2696.   DO
  2697.     SAY 
  2698.     SAY pen3'No files in' bbspath'Information drawer!'def
  2699.     SAY 
  2700.     RETURN;
  2701.   END
  2702. SAY pen3'These text files are available for reading online...'def
  2703. IF ~DATATYPE(sortinfo.0,'N') THEN
  2704.   DO
  2705.     info.=''
  2706.     info.0=WORDS(infolist)
  2707.     DO i=1 TO info.0
  2708.       info.i=WORD(infolist,i)
  2709.     END
  2710.     SAY 'Sorting..'
  2711.     CALL QSORT(1,info.0,info)
  2712.     SAY lineup'         'lineup
  2713.     sortinfo.=''
  2714.     sortinfo.0=info.0%3
  2715.     IF (info.0//3)>0 THEN sortinfo.0=sortinfo.0+1
  2716.     DO i=1 TO sortinfo.0
  2717.       sortinfo.i=''
  2718.       DO j=0 TO 2
  2719.         k=i+j*sortinfo.0
  2720.         IF k<=info.0 THEN sortinfo.i=sortinfo.i RIGHT(k,3)'.' LEFT(info.k,20)
  2721.       END
  2722.     END
  2723.   END
  2724. DO FOREVER
  2725.   SAY pen3||LEFT('-',75,'-')||def
  2726.   DO i=1 TO sortinfo.0
  2727.     SAY sortinfo.i
  2728.   END
  2729.   num=getinput(1 0 pen3'Select Number Of Information File To View> 'def);
  2730.   IF ~DATATYPE(num,'N') | num<1 | num>info.0 THEN RETURN;
  2731.   CALL readlines(bbspath'Information/'info.num 1);
  2732.   CALL seelines();
  2733.   IF waitchar~='Q' THEN CALL waiting();
  2734.   nonstop=0
  2735. END
  2736. RETURN;
  2737.  
  2738.  
  2739. newfiles:
  2740. SAY 
  2741. SAY 'Searching for new (un-browsed) files since' DATE(,WORD(data.16,2),'S') 'at' WORD(data.16,3)'...'
  2742. SAY pen3' - Use CTRL-E to Exit -'def
  2743. lastbrowz=WORD(data.16,1)
  2744. lastfileup=countcheck(bbspath'Numbers/LastFile' 0)
  2745. j=0
  2746. DO ni=lastfileup TO lastbrowz+1 BY -1
  2747.   IF files.ni~='' THEN
  2748.     DO
  2749.       DO ii=level+1 TO sysoplevel
  2750.         IF UPPER(dirs.ii)=UPPER(WORD(files.ni,1)) THEN ITERATE ni /* unauthorized */
  2751.       END
  2752.       j=j+1
  2753.       SAY RIGHT(ni,4)'.' LEFT(WORD(files.ni,2),20) pen3':'WORD(files.ni,1)||def
  2754.       IF j//linesperpage=0 THEN CALL waiting();
  2755.     END
  2756. END
  2757. IF j//linesperpage~=0 THEN CALL waiting();
  2758. CALL newinfo(1);
  2759. IF j>0 THEN
  2760.   DO
  2761.     SAY ' - To reset the ['pen3'N'def']ew files date, you must ['pen3'B'def']rowse at least one file. -'
  2762.     SAY '      - Use the ['pen3'B'def']rowse command to see file descriptions. -'
  2763.     CALL waiting();
  2764.   END
  2765. ELSE SAY 'No new files found in the libraries.'
  2766. nonstop=0
  2767. RETURN;
  2768.  
  2769.  
  2770. newinfo:
  2771. ARG startinfo .
  2772. IF startinfo=1 THEN
  2773.   DO
  2774.     lynes.=''
  2775.     lynes.0=0
  2776.   END
  2777. IF WORD(STATEF(bbspath'Information'),5)>lastondate THEN
  2778.   DO
  2779.     lynes.startinfo=pen1||bak2' New or Updated Information Files. Enter'def pen3'I'def bak2'from the main menu to read 'def
  2780.     dm=DATE(,WORD(data.16,2),'S')
  2781.     PARSE VAR dm da' 'mo' 'yr .
  2782.     yr=RIGHT(yr,2)
  2783.     sincedate=da'-'mo'-'yr
  2784.     ADDRESS COMMAND 'LIST >ram:dirlist' bbspath'Information NOHEAD DATES SINCE' sincedate
  2785.     CALL readlines('ram:dirlist' startinfo+1);
  2786.   END
  2787. IF lynes.0>0 THEN CALL seelines();
  2788. nonstop=0
  2789. RETURN;
  2790.  
  2791.  
  2792. areaselect:
  2793. SAY pen3||LEFT('-',75,'-')||def
  2794. DO i=1 TO msgs.0
  2795.   SAY msgs.i
  2796. END
  2797. temp=getinput(1 0 pen3'Select Message Conference: 'def);
  2798. IF ~DATATYPE(temp,'N') | temp<1 | temp>level | FIND(data.21,temp)>0 THEN RETURN(1);
  2799. msgdir=temp
  2800. RETURN(0);
  2801.  
  2802.  
  2803. chdir:
  2804. string=''
  2805. SAY pen3||LEFT('-',75,'-')||def
  2806. DO i=1 TO libs.0
  2807.   SAY libs.i
  2808. END
  2809. dirnum=getinput(1 0 pen3'Select Library Number: 'def);
  2810. IF ~DATATYPE(dirnum,'N') THEN
  2811.   DO
  2812.     waitchar=dirnum
  2813.     RETURN(2);
  2814.   END
  2815.  
  2816. chdir2:
  2817. IF dirnum<1 | dirnum>99 THEN
  2818.   DO
  2819.     waitchar=dirnum
  2820.     RETURN(1);
  2821.   END
  2822. IF dirs.dirnum='' THEN
  2823.   DO
  2824.     SAY pen3'That library number in currently un-assigned.'def
  2825.     RETURN(1);
  2826.   END
  2827. IF dirnum>level | FIND(data.21,UPPER(dirs.dirnum))>0 THEN
  2828.   DO
  2829.     SAY pen3'You do not have authorization for that library!'def
  2830.     RETURN(1);
  2831.   END
  2832. IF dirs.dirnum~='' THEN
  2833.   DO
  2834.     CALL MAKEDIR(libpath||dirs.dirnum)
  2835.     CALL setdir(libpath||dirs.dirnum)
  2836.   END
  2837. RETURN(0);
  2838.  
  2839.  
  2840. since:
  2841. IF WORDS(data.16)<3 THEN data.16='0 19900101 00:00:00'
  2842. dm=DATE(,WORD(data.16,2),'S')
  2843. SAY 
  2844. SAY 'New files since' dm
  2845. CALL listsince('')
  2846. CALL readlines('RAM:dirlist' 1)
  2847. CALL seelines();
  2848. nonstop=0
  2849. CALL waiting();
  2850. RETURN;
  2851.  
  2852.  
  2853. listsince:
  2854. ARG listarg
  2855. IF WORDS(data.16)<3 THEN data.16='0 19900101 00:00:00'
  2856. dm=DATE(,WORD(data.16,2),'S')
  2857. PARSE VAR dm da' 'mo' 'yr .
  2858. yr=RIGHT(yr,2)
  2859. sincedate=da'-'mo'-'yr
  2860. ADDRESS COMMAND list '>RAM:dirlist' directory listarg 'DATES SINCE' sincedate
  2861. RETURN;
  2862.  
  2863.  
  2864. list:
  2865. onetime=0
  2866. IF DATATYPE(arg,'N') THEN onetime=1
  2867. ELSE arg=''
  2868. DO listloop=1
  2869.   IF DATATYPE(arg,'N') THEN
  2870.     DO
  2871.       dirnum=arg
  2872.       arg=''
  2873.       IF chdir2()>0 THEN RETURN;
  2874.     END
  2875.   ELSE IF arg~='' THEN RETURN;
  2876.   ELSE IF chdir()>0 THEN RETURN;
  2877.   CALL listsimple();
  2878.   IF waitchar~='' THEN RETURN;
  2879.   IF onetime THEN LEAVE listloop
  2880. END
  2881. RETURN;
  2882.  
  2883.  
  2884. listsimple:
  2885. ADDRESS COMMAND list '>RAM:dirlist' directory 'DATES'
  2886. IF readlines('RAM:dirlist' 1) THEN RETURN;
  2887. IF lynes.0>3 THEN
  2888.   DO
  2889.     SAY pen3'Sorting...'def||lineup
  2890.     linesave=lynes.1  /* these extra lines put in to leave dir title at top */
  2891.     lynes.1='0'
  2892.     CALL QSORT(1,lynes.0-1,lynes)
  2893.     CALL DELAY(14)
  2894.     lynes.1=linesave
  2895.   END
  2896. CALL seelines();
  2897. nonstop=0
  2898. CALL waiting();
  2899. RETURN;
  2900.  
  2901.  
  2902. browse:
  2903. curdironly=0
  2904. brdir=PRAGMA('D')
  2905. brfilenum=1
  2906. IF files.0<1 THEN RETURN;
  2907. IF arg='' THEN
  2908.   DO
  2909.     line='Browsing'
  2910.     test=getinput(1 1 'Browse the' pen3||plaindir||def 'library only? (yN) > ')
  2911.     IF test='Y' THEN
  2912.       DO
  2913.         curdironly=1
  2914.         line=line 'the' pen3||plaindir||def 'library'
  2915.       END
  2916.     ELSE line=line 'all file libraries'
  2917.     line=line 'backwards from latest file.'
  2918.     SAY line
  2919.   END
  2920. lastfilenum=countcheck(bbspath'Numbers/LastFile' 0)
  2921. IF lastfilenum<1 THEN RETURN;
  2922. i=0
  2923. IF arg='' | UPPER(arg)='NEW' | UPPER(arg)='ALL' THEN
  2924.   DO
  2925.     arg=WORD(files.lastfilenum,2)
  2926.     IF arg='' THEN RETURN;
  2927.     brfilenum=lastfilenum
  2928.   END
  2929. ELSE IF DATATYPE(arg,'N') & files.arg~='' THEN
  2930.   DO
  2931.     brfilenum=arg
  2932.     arg=WORD(files.arg,2)
  2933.   END
  2934. ELSE
  2935.   DO
  2936.     DO i=1 TO lastfilenum+1
  2937.       IF UPPER(WORD(files.i,2))~=UPPER(arg) THEN ITERATE i
  2938.       brfilenum=i
  2939.       LEAVE i
  2940.     END
  2941.     IF i>lastfilenum THEN
  2942.       DO
  2943.         SAY 'Unable to find a file description for' pen3||arg||def'.'
  2944.         RETURN;
  2945.       END
  2946.   END
  2947. CALL setdir(libpath||WORD(files.brfilenum,1))
  2948. savearg=arg
  2949. IF brfilenum>lastfilenum THEN brfilenum=lastfilenum
  2950. newfilesdate=DATE('S') TIME()
  2951. DO browseloop=1
  2952.   DO i=brfilenum TO 0 BY -1
  2953.     IF files.i='' THEN ITERATE i
  2954.     testdir=UPPER(WORD(files.i,1))
  2955.     IF curdironly & UPPER(brdir)~=libpath||UPPER(testdir) THEN
  2956.       DO
  2957.         IF i>lastbrowse THEN lastbrowse=i
  2958.         ITERATE i
  2959.       END
  2960.     IF FIND(data.21,testdir)>0 | finddirnum(testdir)>level THEN
  2961.       DO
  2962.         IF i>lastbrowse THEN lastbrowse=i
  2963.         ITERATE i
  2964.       END
  2965.     LEAVE i
  2966.   END
  2967.   IF i=0 THEN brfilenum=lastbrowse;
  2968.   ELSE brfilenum=i
  2969.   argname=WORD(files.i,2)
  2970.   IF argname='' THEN RETURN;
  2971.   CALL setdir(libpath||WORD(files.i,1))
  2972.   arg=bbspath'FileNotes/'plaindir'/'argname
  2973.   CALL readlines(arg 1);
  2974.   IF nonstop=1 THEN brostop=1
  2975.   ELSE brostop=0
  2976.   CALL seelines();
  2977.   IF brfilenum>lastbrowse THEN lastbrowse=brfilenum
  2978.   IF brostop THEN
  2979.     DO
  2980.       SAY
  2981.       nonstop=1
  2982.       brfilenum=brfilenum-1
  2983.     END
  2984.   ELSE
  2985.     DO
  2986.       line=''
  2987.       endtest=UPPER(RIGHT(argname,4))
  2988.       line='['pen3'C'def']ontents ['pen3'D'def']ownload'
  2989.       line=line '['pen3'H'def']elp ['pen3'N'def']on-Stop'
  2990.       IF level>sysoplevel | name=WORD(lynes.3,2) THEN
  2991.         line=line '['pen3'E'def']dit ['pen3'K'def']ill'
  2992.       IF level>sysoplevel THEN line=line '['pen3'M'def']ove'
  2993.       line=line '['pen3'Q'def']uit > '
  2994.       brcom=getinput(1 0 line);
  2995.       IF DATATYPE(brcom,'N') THEN
  2996.         DO
  2997.           brfilenum=brcom+1
  2998.           SAY
  2999.         END
  3000.       ELSE brcom=LEFT(brcom,1)
  3001.       CALL cleanline(0);
  3002.       IF brcom='Q' THEN LEAVE browseloop
  3003.       ELSE IF brcom='H' THEN
  3004.         DO
  3005.           SAY pen3' - HELP with the Browse Files commands -'def
  3006.           SAY ' RETURN reads the next file description in line.'
  3007.           SAY ' 34 will display the description of file number 34, if it exists.'
  3008.           SAY ' C  displays the contents of an archived (lzh|arc|zoo|zip) file.'
  3009.           SAY ' D  starts sending this file to you using the current protocol.'
  3010.           IF level>sysoplevel | name=WORD(lynes.3,2) THEN
  3011.             DO
  3012.           SAY ' E  puts this file description into the online Editor.'
  3013.           SAY ' K  deletes a file you uploaded. you cannot Kill others!'
  3014.             END
  3015.           IF level>sysoplevel THEN
  3016.           SAY ' M  move file and description to new library.'
  3017.           SAY ' N  displays all descriptions without pausing. CTRL-E to Exit!'
  3018.           SAY ' Q  returns to the main menu(s). (Quit)'
  3019.           SAY
  3020.           CALL waiting();
  3021.           IF waitchar='Q' THEN LEAVE browseloop
  3022.         END
  3023.       ELSE IF brcom='M' THEN
  3024.         DO
  3025.           mvdir=getinput(0 0 'Move' argname 'to library (name|number) ')
  3026.           IF mvdir~='' THEN
  3027.             DO
  3028.               IF DATATYPE(mvdir,'N') THEN
  3029.                 DO
  3030.                   dirnum=mvdir
  3031.                   IF chdir2()=0 THEN
  3032.                     CALL movefile(brfilenum dirs.dirnum);
  3033.                 END
  3034.               ELSE
  3035.                 DO
  3036.                   mvdir=STRIP(mvdir)
  3037.                   DO mj=1 TO level+1
  3038.                     IF UPPER(mvdir)=UPPER(dirs.mj) THEN LEAVE mj
  3039.                   END
  3040.                   IF mj<=level THEN CALL movefile(brfilenum mvdir)
  3041.                 END
  3042.             END
  3043.         END
  3044.       ELSE IF brcom='N' THEN
  3045.         DO
  3046.           brfilenum=brfilenum-1
  3047.           nonstop=1
  3048.           SAY pen3'To EXIT non-stop scrolling of text, press CTRL-E'def
  3049.           SAY
  3050.           brcom=''
  3051.         END
  3052.       ELSE IF brcom='C' THEN
  3053.         DO
  3054.           arcomm='lharc'
  3055.           IF endtest='.ARC' THEN arcomm='arc'
  3056.           IF endtest='.ZOO' THEN arcomm='zoo'
  3057.           IF endtest='.ZIP' THEN
  3058.                ADDRESS COMMAND 'unzip >ram:CONTENTS -v' argname
  3059.           ELSE ADDRESS COMMAND arcomm '>ram:CONTENTS v' argname
  3060.           CALL readlines('RAM:CONTENTS' 1)
  3061.           CALL seelines();
  3062.           CALL waiting();
  3063.           nonstop=0
  3064.         END
  3065.       ELSE IF brcom='D' THEN
  3066.         DO
  3067.           arg2=arg
  3068.           arg=argname
  3069.           CALL dload();
  3070.           arg=arg2
  3071.         END
  3072.       ELSE IF brcom='E' THEN
  3073.         DO
  3074.           IF level>sysoplevel | name=WORD(lynes.3,2) THEN
  3075.             DO
  3076.               firstedit=5
  3077.               IF level>sysoplevel THEN firstedit=1
  3078.               CALL bbsED(firstedit arg);
  3079.             END
  3080.         END
  3081.       ELSE IF brcom='K' THEN
  3082.         DO
  3083.           IF level>sysoplevel | name=WORD(lynes.3,2) THEN
  3084.             DO
  3085.               IF getinput(1 1 pen3'Do you really want to kill this file? (nY) >'def)~='N' THEN
  3086.                 DO
  3087.                   tempnum=WORD(lynes.1,2)
  3088.                   files.tempnum=''
  3089.                   CALL savefilelist();
  3090.                   CALL DELETE(argname)
  3091.                   CALL DELETE(arg)
  3092.                   SAY argname pen3'has been deleted.'def
  3093.                 END
  3094.             END
  3095.         END
  3096.       ELSE brfilenum=brfilenum-1
  3097.     END
  3098. END
  3099. CALL setdir(brdir)
  3100. waitchar=''
  3101. IF nonstop THEN CALL waiting();
  3102. nonstop=0
  3103. CALL savedata(0);
  3104. RETURN;
  3105.  
  3106.  
  3107. movefile:
  3108. PARSE ARG fnum movdir .
  3109. fdir=STRIP(WORD(files.fnum,1))
  3110. farg=STRIP(WORD(files.fnum,2))
  3111. CALL MAKEDIR(libpath||movdir)
  3112. ADDRESS COMMAND 'COPY' libpath||fdir'/'farg libpath||movdir
  3113. IF EXISTS(libpath||fdir'/'farg) THEN CALL DELETE(libpath||fdir'/'farg)
  3114. files.fnum=movdir farg
  3115. lynes.3=DELWORD(lynes.3,WORDS(lynes.3),1)
  3116. lynes.3=STRIP(lynes.3) movdir
  3117. CALL MAKEDIR(bbspath'FileNotes/'movdir)
  3118. CALL savelines(bbspath'FileNotes/'movdir'/'farg);
  3119. CALL savefilelist();
  3120. CALL DELETE(bbspath'FileNotes/'fdir'/'farg)
  3121. line='Moved:' fdir'/'farg 'to' movdir
  3122. SAY line
  3123. RETURN;
  3124.  
  3125.  
  3126. textsearch:
  3127. PARSE ARG sfile sarg
  3128. x=OPEN(f,sfile,'R')
  3129. IF x=0 THEN RETURN(0);
  3130. sarg=UPPER(sarg)
  3131. stemp=UPPER(READCH(f,65000))
  3132. CALL CLOSE(f)
  3133. IF POS(sarg,stemp)>0 THEN RETURN(1);
  3134. RETURN(0);
  3135.  
  3136.  
  3137. bbsSEARCH:
  3138. IF menu='ALL' THEN
  3139.   DO
  3140.     junk=getinput(1 1 'Search ['pen3'F'def']iles ['pen3'M'def']essages or ['pen3'U'def']sers > ')
  3141.     IF junk='F' THEN smenu='FILE'
  3142.     ELSE IF junk='M' THEN smenu='MSG'
  3143.     ELSE IF junk='U' THEN smenu='MAIN'
  3144.     ELSE RETURN;
  3145.   END
  3146. ELSE smenu=menu
  3147. searcharg=''
  3148. searcharg=getinput(0 0 pen3'Search Phrase: 'def)
  3149. IF LENGTH(STRIP(searcharg))=0 THEN RETURN;
  3150. searcharg=COMPRESS(searcharg,'*')
  3151. lynes.=''
  3152. lynes.0=1
  3153. IF smenu='NEW' | smenu='MAIN' THEN
  3154.   DO
  3155.     SAY 'Searching Userlist...'
  3156.     lynes.1='These user names matched' searcharg'.'
  3157.     DO i=1 TO WORDS(userlist)
  3158.       IF POS(UPPER(searcharg),UPPER(WORD(userlist,i)))>0 THEN
  3159.         DO
  3160.           count=lynes.0+1
  3161.           lynes.count=WORD(userlist,i)
  3162.           lynes.0=count
  3163.         END
  3164.     END
  3165.   END
  3166. IF smenu='MSG' THEN
  3167.   DO
  3168.     SAY 'Searching Message Conferences...'
  3169.     lynes.1=searcharg 'was found in these messages.'
  3170.     DO msgdir=1 TO level
  3171.       IF msgdir>level THEN LEAVE msgdir
  3172.       IF msg.msgdir='' | FIND(data.21,msgdir)>0 THEN ITERATE msgdir
  3173.       msglist=SHOWDIR(msgpath||msgdir)
  3174.       IF WORDS(msglist)>0 THEN SAY lineup||RIGHT(msg.msgdir,40)
  3175.       DO i=1 TO WORDS(msglist)
  3176.         IF textsearch(msgpath||msgdir'/'WORD(msglist,i) searcharg) THEN
  3177.           DO
  3178.             count=lynes.0+1
  3179.             lynes.count='MSG:' RIGHT(WORD(msglist,i),5) 'in' msg.msgdir
  3180.             lynes.0=count
  3181.           END
  3182.       END
  3183.     END
  3184.   END
  3185. IF smenu='FILE' THEN
  3186.   DO
  3187.     SAY 'Searching File Descriptions...'
  3188.     lynes.1=searcharg 'was found in the Descriptions of these files.'
  3189.     DO i=1 TO countcheck(bbspath'Numbers/LastFile' 0)
  3190.       IF files.i='' THEN ITERATE i
  3191.       testdir=UPPER(WORD(files.i,1))
  3192.       IF FIND(excludelist,testdir)>0 THEN ITERATE i
  3193.       IF finddirnum(testdir)>level THEN ITERATE i
  3194.       farg=WORD(files.i,1)'/'WORD(files.i,2)
  3195.       SAY lineup||RIGHT(farg,40)
  3196.       IF textsearch(bbspath'FileNotes/'farg searcharg) THEN
  3197.         DO
  3198.           SAY lineup||RIGHT(i,5)'.' LEFT(WORD(files.i,2),30) 'Library:' pen3||WORD(files.i,1)||def
  3199.           SAY
  3200.         END
  3201.     END
  3202.   END
  3203. CALL cleanline(0);
  3204. IF smenu~='FILE' THEN
  3205.   DO
  3206.     IF lynes.0<2 THEN
  3207.       DO
  3208.         SAY lineup'No matches to' searcharg 'were found.'
  3209.         RETURN;
  3210.       END
  3211.     CALL seelines();
  3212.   END
  3213. nonstop=0
  3214. CALL waiting();
  3215. RETURN;
  3216.  
  3217.  
  3218.  
  3219. finddirnum:
  3220. ARG fdirname
  3221. DO fdir=1 TO 99
  3222.   IF UPPER(dirs.fdir)=fdirname THEN RETURN(fdir);
  3223. END
  3224. RETURN(100);
  3225.  
  3226.  
  3227. writebuffer:
  3228. PARSE ARG bufname .
  3229. CALL DELETE(bufname)
  3230. IF bufname=scratch'/EditorFile' THEN startnum=lynes.0+1
  3231. ELSE IF bufname=scratch'/MessageFile' THEN startnum=7
  3232. ELSE IF bufname=scratch'/NoteFile' THEN startnum=5
  3233. ELSE startnum=1
  3234. OPTIONS PROMPT ''
  3235. SAY pen3'LOCAL logon! Input cannot exceed 250 characters per line!'def
  3236. SAY 'Type 'pen3'/END'def' on a new line to exit and' pen3'DO YOUR OWN WORDWRAP!'def
  3237. DO bufloop=startnum
  3238.   PARSE PULL line
  3239.   IF UPPER(STRIP(line))='/END' THEN LEAVE bufloop
  3240.   lynes.bufloop=line
  3241. END
  3242. lynes.0=bufloop-1
  3243. CALL wrapbuf(startnum)
  3244. CALL savelines(bufname);
  3245. RETURN;
  3246.  
  3247.  
  3248. wrapbuf:
  3249. CALL cleanline(1);
  3250. SAY pen3'Wordwrapping...'def
  3251. ARG startnum .
  3252. lynes.startnum=COMPRESS(lynes.startnum,'0C'x)  /* no FF */
  3253. DO wi=startnum WHILE wi<=lynes.0
  3254.   wj=wi+1
  3255.   lynes.wj=COMPRESS(lynes.wj,'08'x||'0C'x||'7F'x)
  3256.   tabpos=POS('09'x,lynes.wi)
  3257.   DO WHILE tabpos>0
  3258.     lynes.wi=DELSTR(lynes.wi,tabpos,1)
  3259.     lynes.wi=INSERT('  ',lynes.wi,tabpos-1)
  3260.     tabpos=POS('09'x,lynes.wi)
  3261.   END
  3262.   IF LENGTH(lynes.wi)>78 & WORDS(lynes.wi)>1 THEN
  3263.     DO
  3264.       testchar=''
  3265.       IF lynes.wj~='' THEN testchar=LEFT(lynes.wj,1)
  3266.       IF testchar=' ' | testchar='.' | testchar='09'x THEN
  3267.         DO
  3268.           DO wj=lynes.0 TO wi+1 BY -1
  3269.             wk=wj+1
  3270.             lynes.wk=lynes.wj
  3271.           END
  3272.           wj=wi+1
  3273.           lynes.wj=''
  3274.           lynes.0=lynes.0+1
  3275.         END
  3276.       DO wl=WORDS(lynes.wi) TO 1 BY -1 WHILE LENGTH(lynes.wi)>74
  3277.         lynes.wj=WORD(lynes.wi,wl) lynes.wj
  3278.         lynes.wi=STRIP(DELWORD(lynes.wi,wl,1))
  3279.       END
  3280.     END
  3281. END
  3282. RETURN;
  3283.  
  3284.  
  3285. seelines:
  3286. DO i=1 TO lynes.0
  3287.   IF LEFT(lynes.i,2)=': ' THEN SAY pen2||lynes.i||def
  3288.   ELSE IF LEFT(lynes.i,10)='Directory ' | LEFT(lynes.i,5)='=====' THEN
  3289.     SAY pen3||lynes.i||def
  3290.   ELSE SAY lynes.i
  3291.   IF i//linesperpage=0 & nonstop~=1 THEN
  3292.     DO
  3293.       waitchar=getinput(1 1 pen3'   Q=Quit   N=Non-Stop   RETURN=Continue   'def);
  3294.       IF waitchar='N' THEN
  3295.         DO
  3296.           nonstop=1
  3297.           SAY lineup||pen3'To EXIT non-stop scrolling of text, press CTRL-E        'def
  3298.           SAY
  3299.           waitchar=''
  3300.         END
  3301.       IF waitchar='Q' THEN LEAVE i
  3302.       CALL cleanline(1);
  3303.     END
  3304. END
  3305. nonstop=0
  3306. RETURN;
  3307.  
  3308.  
  3309. readlines:
  3310. CALL CLOSE(f)
  3311. PARSE ARG tempname readstart .
  3312. IF ~readopen(tempname) THEN RETURN(1);
  3313. IF readstart<2 THEN lynes.=''
  3314. DO ri=readstart
  3315.   line=READLN(f)
  3316.   IF EOF(f) THEN BREAK;
  3317.   lynes.ri=line
  3318. END
  3319. lynes.0=ri-1
  3320. CALL CLOSE(f)
  3321. DO ri=lynes.0 TO 0 BY -1 WHILE LENGTH(lynes.ri)=0 | UPPER(lynes.ri)='/END'
  3322. END
  3323. lynes.0=ri
  3324. RETURN(0);
  3325.  
  3326.  
  3327. savelines:
  3328. PARSE ARG tempname .
  3329. IF EXISTS(tempname) & edtype='MAIL' THEN
  3330.   DO
  3331.     ok=OPEN(f,tempname,'A')
  3332.     IF ok~=0 THEN CALL WRITELN(f,INSERT('','',1,75,'^'))
  3333.   END
  3334. ELSE ok=OPEN(f,tempname,'W')
  3335. IF ok=0 THEN
  3336.   DO
  3337.     line='***' tempname 'failed to open for saving!'
  3338.     SAY line
  3339.     RETURN(1);
  3340.   END
  3341. DO wi=1 TO lynes.0
  3342.   CALL WRITELN(f,lynes.wi)
  3343. END
  3344. CALL CLOSE(f)
  3345. RETURN(0);
  3346.  
  3347.  
  3348. loaduserlist:
  3349. userlist=SHOWDIR(bbspath'Users')
  3350. ulynes.=''
  3351. IF ~EXISTS(bbspath'Lists/USERS') THEN CALL sortuserlist();
  3352. ELSE IF readopen(bbspath'Lists/USERS') THEN
  3353.   DO
  3354.     DO i=1
  3355.       line=READLN(f)
  3356.       IF EOF(f) THEN BREAK;
  3357.       ulynes.i=line
  3358.     END
  3359.     ulynes.0=i-1
  3360.     CALL CLOSE(f)
  3361.   END
  3362. RETURN;
  3363.  
  3364.  
  3365. saveuserlist:
  3366. IF writeopen(bbspath'Lists/USERS') THEN
  3367.   DO
  3368.     DO i=1 TO ulynes.0
  3369.       CALL WRITELN(f,ulynes.i)
  3370.     END
  3371.     CALL CLOSE(f)
  3372.   END
  3373. RETURN;
  3374.  
  3375.  
  3376. sortuserlist:
  3377. SAY 'Rebuilding Userlist...'
  3378. userlist=SHOWDIR(bbspath'Users')
  3379. user.=''
  3380. users=WORDS(userlist)
  3381. user.0=users
  3382. DO uli=1 TO users
  3383.   user.uli=WORD(userlist,uli)
  3384.   uscore=LASTPOS('_',user.uli)
  3385.   IF uscore>0 THEN user.uli=SUBSTR(user.uli,uscore+1)'@'LEFT(user.uli,uscore-1)
  3386. END
  3387. CALL QSORT(1,users,user)
  3388. DO uli=1 TO users
  3389.   uscore=POS('@',user.uli)
  3390.   IF uscore>0 THEN user.uli=SUBSTR(user.uli,uscore+1)'_'LEFT(user.uli,uscore-1)
  3391. END
  3392. ulynes.=''
  3393. ulynes.0=user.0%3
  3394. IF (user.0//3)>0 THEN ulynes.0=ulynes.0+1
  3395. DO i=1 TO ulynes.0
  3396.   ulynes.i=LEFT(user.i,25)
  3397.   DO j=1 TO 2
  3398.     k=i+j*ulynes.0
  3399.     IF k<=users THEN ulynes.i=ulynes.i' 'LEFT(user.k,25)
  3400.   END
  3401. END
  3402. CALL saveuserlist();
  3403. RETURN;
  3404.  
  3405.  
  3406. showuserlist:
  3407. IF data.5='' THEN line='Here are the EMail names of your fellow users.'
  3408. ELSE line='   'WORDS(userlist) 'users. Use these names to address messages.'
  3409. SAY pen3||line||def
  3410. DO uli=1 TO ulynes.0
  3411.   SAY ulynes.uli
  3412.   IF uli//linesperpage=0 & uli<ulynes.0 THEN CALL waiting();
  3413.   IF waitchar='Q' THEN RETURN;
  3414. END
  3415. IF data.5~='' THEN CALL waiting();
  3416. RETURN;
  3417.  
  3418.  
  3419. msgcount:
  3420. ARG countdir .
  3421. lastmess=0
  3422. IF ~EXISTS(msgpath||countdir) THEN RETURN;
  3423. lastread.countdir=WORD(data.22,countdir)
  3424. IF ~DATATYPE(lastread.countdir,'N') THEN lastread.countdir=0
  3425. IF lastread.countdir<0 THEN RETURN;
  3426. lastmess=countcheck(bbspath'Numbers/LastMessage'countdir 0)
  3427. firstmess=countcheck(bbspath'Numbers/FirstMessage'countdir 0)
  3428. IF lastread.countdir<firstmess THEN lastread.countdir=firstmess-1
  3429. IF DATATYPE(msg.countdir.0,'N') THEN totmsgs=msg.countdir.0
  3430. totmsgs=lastmess
  3431. msg.countdir.0=totmsgs
  3432. IF totmsgs<(lastmess-lastread.countdir) THEN totmsgs=lastmess-lastread.countdir
  3433. IF lastmess>0 THEN
  3434.   IF lastread.countdir>=0 & ~logonflag THEN
  3435.     DO
  3436.       cline=RIGHT(lastmess-lastread.countdir,6) 'unread of' RIGHT(totmsgs,4)
  3437.       cline=cline 'messages in the 'CENTER(msg.countdir,20)' conference.'
  3438.       SAY pen6||cline||def
  3439.     END
  3440. RETURN;
  3441.  
  3442.  
  3443. counts:
  3444. cmin=countcheck(bbspath'Numbers/Minutes' 0)
  3445. chr=cmin%60
  3446. cmin=cmin//60
  3447. SAY
  3448. SAY 'Total Connect Time Since First Logon [all users]:' chr 'hours' cmin 'minutes.'
  3449. prevcaller=GETCLIP('BBS_prevcaller')
  3450. IF prevcaller~='' THEN
  3451.   DO
  3452.     SAY
  3453.     SAY 'The previous BBS user was' prevcaller
  3454.     IF level>sysoplevel THEN
  3455.       DO
  3456.         SAY '  logged off at:' GETCLIP('BBS_userlogoff')
  3457.         SAY pen3'Last disconnect:'def GETCLIP('BBS_disconnect')
  3458.       END
  3459.   END
  3460. ds=DATE()
  3461. ds=WORD(ds,2)||WORD(ds,3)
  3462. usageclip=GETCLIP('BBS_totalusage')
  3463. IF usageclip='' THEN CALL bbsUSAGE.baud(ds)
  3464. ELSE
  3465.   DO
  3466.     SAY
  3467.     SAY 'Total BBS Usage For' DATE('M') WORD(DATE(),3)':' WORD(usageclip,1) 'hours' WORD(usageclip,2) 'minutes.'
  3468.   END
  3469. CALL bbsspace();
  3470. SAY RIGHT(countcheck(bbspath'Numbers/Calls' 0),19)'  completed calls.'
  3471. SAY RIGHT(countcheck(bbspath'Numbers/LastMail' 0),19)'  private messages.'
  3472. totmsg=0
  3473. DO conf=1 TO 99
  3474.   IF msg.conf~='' THEN totmsg=totmsg+countcheck(bbspath'Numbers/LastMessage'conf 0)
  3475. END
  3476. SAY RIGHT(totmsg,19)'  public messages.'
  3477. SAY RIGHT(files.0,19)'  public files.'
  3478. SAY RIGHT(WORDS(userlist),19)'  users.'
  3479. SAY
  3480. SAY '  You Have'
  3481. totmail=WORD(data.17,2)
  3482. IF ~DATATYPE(totmail,'N') THEN totmail=0
  3483. totmsg=0
  3484. DO ti=1 TO level
  3485.   temp=WORD(data.23,ti)
  3486.   IF DATATYPE(temp,'N') THEN totmsg=totmsg+WORD(data.23,ti)
  3487. END
  3488. SAY '   Written' RIGHT(totmsg,8) 'public &' RIGHT(totmail,4) 'private  messages.'
  3489. totfiles=WORD(data.14,1)
  3490. IF ~DATATYPE(totfiles,'N') THEN totfiles=0
  3491. totbytes=WORD(data.14,3)
  3492. IF ~DATATYPE(totbytes,'N') THEN totbytes=0
  3493. SAY '  Uploaded' RIGHT(totbytes,8) 'bytes in' RIGHT(totfiles,4) 'files.'
  3494. totfiles=WORD(data.15,1)
  3495. IF ~DATATYPE(totfiles,'N') THEN totfiles=0
  3496. totbytes=WORD(data.15,3)
  3497. IF ~DATATYPE(totbytes,'N') THEN totbytes=0
  3498. SAY 'Downloaded' RIGHT(totbytes,8) 'bytes in' RIGHT(totfiles,4) 'files.'
  3499. SAY '..and been on this BBS a total of' data.19
  3500. SAY
  3501. CALL waiting();
  3502. CALL showmarked();
  3503. CALL logonstats();
  3504. CALL waiting();
  3505. RETURN;
  3506.  
  3507.  
  3508. logonstats:
  3509. IF level=0 THEN RETURN;
  3510. SAY bak2||name||def 'Last on' DATE('W',lastondate,'I') DATE(,lastondate,'I')
  3511. lastbrowse=WORD(data.16,1)
  3512. IF ~DATATYPE(lastbrowse,'N') THEN lastbrowse=0
  3513. tempnum=countcheck(bbspath'Numbers/LastFile' 0)-lastbrowse
  3514. IF tempnum>files.0 THEN tempnum=files.0
  3515. IF tempnum>0 THEN SAY pen6||RIGHT(tempnum,6) 'new of' files.0 'files.'def
  3516. ELSE SAY 'No new files.'
  3517. totmsg=0
  3518. grand=0
  3519. DO i=1 TO level
  3520.   IF msg.i='' | FIND(data.21,i)>0 THEN ITERATE i
  3521.   CALL msgcount(i)
  3522.   totmsg=totmsg+lastmess-lastread.i
  3523.   grand=grand+lastmess
  3524. END
  3525. IF totmsg>0 THEN SAY pen6||RIGHT(totmsg,6) 'new of' grand 'messages.'def
  3526. ELSE SAY 'No new messages.'
  3527. RETURN;
  3528.  
  3529.  
  3530. readopen:
  3531. PARSE ARG fname
  3532. ok=OPEN(f,fname,'R')
  3533. IF ok~=0 THEN RETURN(1);
  3534. line=fname 'failed to open for reading!'
  3535. SAY line
  3536. RETURN(0);
  3537.  
  3538.  
  3539. writeopen:
  3540. PARSE ARG fname
  3541. CALL CLOSE(f)
  3542. ok=OPEN(f,fname,'W')
  3543. IF ok~=0 THEN RETURN(1);
  3544. line=fname 'failed to open for writing!'
  3545. SAY line
  3546. RETURN(0);
  3547.  
  3548.  
  3549. SYNTAX:
  3550. FAILURE:
  3551. lin.1=pen7||ERRORTEXT(RC)||def
  3552. lin.2=SIGL-1     SOURCELINE(SIGL-1)
  3553. lin.3=SIGL pen7||SOURCELINE(SIGL)||def
  3554. lin.4=SIGL+1     SOURCELINE(SIGL+1)
  3555. DO er=1 TO 4
  3556.   IF level>sysoplevel THEN SAY lin.er
  3557. END
  3558. IF newpassword='' THEN SIGNAL DONE2  /* no user logged on, quit quietly */
  3559. SAY
  3560. SAY '*** System Error on this Experimental BBS. Or put another way, ***'
  3561. SAY
  3562. SAY pen3'             *** I''ve fallen, and I can''t get up! ***'def
  3563. SAY
  3564. SAY '*** You MAY be able to continue your mission.  Good luck, Jim! ***'
  3565. SAY
  3566. CALL CLOSE(f)
  3567. IF level>sysoplevel THEN
  3568.   DO
  3569.     junk=getinput(1 1 'ReStart: (yN) > ');
  3570.     IF junk~='Y' THEN SIGNAL LOGOUT
  3571.   END
  3572. string=''
  3573. waitchar=''
  3574. IF data.1~='' & data.5~='' & data.20~='' THEN CALL savedata(0);
  3575. SIGNAL RESTART
  3576.  
  3577.  
  3578. BREAK_E:
  3579. CALL CLOSE(f)
  3580. SAY pen3'*** CTRL-E BREAK ***'def
  3581. waitchar=''
  3582. string=''
  3583. nonstop=0
  3584. i=999999
  3585. ni=0
  3586. RETURN(0);
  3587.  
  3588.  
  3589. BREAK_C:
  3590. CALL CLOSE(f)
  3591.  
  3592. LOGOUT:
  3593. secs=TIME('E')
  3594. mins=secs%60
  3595. secs=TRUNC(secs//60)
  3596. IF secs<10 THEN secs='0'secs
  3597. SAY
  3598. SAY 'Time used this call:' mins':'secs
  3599. SAY
  3600. arg = bbspath'BBS_TEXT/GOODBYE'
  3601. IF EXISTS(arg) THEN
  3602.   DO
  3603.     CALL DELAY(14)
  3604.     CALL readlines(arg 1);
  3605.     CALL seelines();
  3606.   END
  3607. SAY
  3608. IF bbsprefs.2 THEN CALL doGrin();
  3609. SAY 
  3610.  
  3611. OUT:
  3612. data.18=winnings
  3613.  
  3614. OUT2:
  3615.  
  3616. DONE:
  3617.  
  3618. DONE2:
  3619. CALL saveData(0);
  3620. EXIT;
  3621.  
  3622. /* end of bbsSYSOP.rexx */
  3623.  
  3624.  
  3625. /*-------  Userfile Data definition  ---  v=view  e=edit ----------------*/
  3626.  
  3627. ve  1 name
  3628. ve  2 address
  3629. ve  3 city state country zip
  3630. ve  4 telephone
  3631. ve  5 password
  3632. ve  6 protocol
  3633. ve  7 lines per page
  3634. ve  8 Preferences: MENU(S) COLOR STREET PHONE etc. On list=YES, ON or PUBLIC.
  3635. ve  9 Computer model
  3636. ve 10 interests        ! SYSOP edit only below this line !
  3637. v  11 nn minutes n more times today  (typically 60 mins 3 times/day).
  3638. v  12 first_date_on  timestamp  age
  3639. v  13 last_date_on  timestamp
  3640. v  14 uploaded files bytes lastdate
  3641. v  15 downloaded files bytes lastdate
  3642. ve 16 lastfilebrowsed lastfilelistdate lastfilelisttime
  3643. ve 17 ul:dl_ratio  total_email_written
  3644. v  18 winnings  
  3645. v  19 total time on this BBS in hours minutes calls
  3646. v  20 level
  3647.    21 exclude dirs by name, separated by spaces. Exclude Conferences by number.
  3648. ve 22 oldest messages read
  3649. v  23 total msgs written per conference
  3650.  
  3651. /* end data defines */
  3652.